aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorErik St. Martin <alakriti@gmail.com>2010-01-31 15:40:40 -0500
committerJoshua Peek <josh@joshpeek.com>2010-01-31 14:43:07 -0600
commite1618b9ac397d1963e788f441fc4965cd3f9d4cf (patch)
treec359978a43277eafe9298d37e4b6e4951c09a992 /actionpack/test
parenta9e89e82b67f721fe68ca58a2d371b666cdb7441 (diff)
downloadrails-e1618b9ac397d1963e788f441fc4965cd3f9d4cf.tar.gz
rails-e1618b9ac397d1963e788f441fc4965cd3f9d4cf.tar.bz2
rails-e1618b9ac397d1963e788f441fc4965cd3f9d4cf.zip
data-remote needs to be on the form and not the submit when using button_to :remote=>true
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/url_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index b498ec8429..e904e88f49 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -81,6 +81,13 @@ class UrlHelperTest < ActionView::TestCase
)
end
+ def test_button_to_with_remote_and_javascript_confirm
+ assert_dom_equal(
+ "<form method=\"post\" action=\"http://www.example.com\" class=\"button-to\" data-remote=\"true\"><div><input data-confirm=\"Are you sure?\" type=\"submit\" value=\"Hello\" /></div></form>",
+ button_to("Hello", "http://www.example.com", :remote => true, :confirm => "Are you sure?")
+ )
+ end
+
def test_button_to_enabled_disabled
assert_dom_equal(
"<form method=\"post\" action=\"http://www.example.com\" class=\"button-to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>",