aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/url_helper_test.rb
diff options
context:
space:
mode:
authorWen-Tien Chang <ihower@gmail.com>2011-09-29 01:40:15 +0800
committerWen-Tien Chang <ihower@gmail.com>2011-09-29 01:40:15 +0800
commit3058d13a06d5472d25d89b55960565d6ba57f1ec (patch)
tree410df8ebcc8b6fc4822309342a1179fd59b3ebc5 /actionpack/test/template/url_helper_test.rb
parentf3b8cd9d364934795ee4ec63a2d8852b3dde1aa8 (diff)
downloadrails-3058d13a06d5472d25d89b55960565d6ba57f1ec.tar.gz
rails-3058d13a06d5472d25d89b55960565d6ba57f1ec.tar.bz2
rails-3058d13a06d5472d25d89b55960565d6ba57f1ec.zip
Make button_to helper support "form" option which is the form attributes.
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r--actionpack/test/template/url_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index dbac2e1fc0..bc45fabf34 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -88,6 +88,10 @@ class UrlHelperTest < ActiveSupport::TestCase
)
end
+ def test_button_to_with_remote_and_form_options
+ assert_dom_equal "<form method=\"post\" action=\"http://www.example.com\" class=\"custom-class\" data-remote=\"true\" data-type=\"json\"><div><input type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com", :remote => true, :form => { :class => "custom-class", "data-type" => "json" } )
+ 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>",