diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-02-02 09:23:07 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-02-02 09:27:25 -0200 |
commit | 3d1095563c7d6f3e32bddbf9008607d921061e58 (patch) | |
tree | b165ff3ec49f2215f205bdc8abafbe3eb6d3949b /actionpack/test | |
parent | 593fe4312fc15fba458cf14e1154eeb8a8ded37c (diff) | |
download | rails-3d1095563c7d6f3e32bddbf9008607d921061e58.tar.gz rails-3d1095563c7d6f3e32bddbf9008607d921061e58.tar.bz2 rails-3d1095563c7d6f3e32bddbf9008607d921061e58.zip |
Replicate :form html5 attribute to hidden field for check_box
When the new html5 attribute :form is given to the check_box helper, it
should be replicated to the hidden field as well. Closes #4848
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 4e440c6a13..9366960caa 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -421,6 +421,13 @@ class FormHelperTest < ActionView::TestCase ) end + def test_checkbox_form_html5_attribute + assert_dom_equal( + '<input form="new_form" name="post[secret]" type="hidden" value="0" /><input checked="checked" form="new_form" id="post_secret" name="post[secret]" type="checkbox" value="1" />', + check_box("post", "secret", :form => "new_form") + ) + end + def test_radio_button assert_dom_equal('<input checked="checked" id="post_title_hello_world" name="post[title]" type="radio" value="Hello World" />', radio_button("post", "title", "Hello World") @@ -2168,8 +2175,8 @@ class FormHelperTest < ActionView::TestCase end protected - def protect_against_forgery? - false - end + def protect_against_forgery? + false + end end |