aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-02-02 03:38:13 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2012-02-02 03:38:13 -0800
commit3ccbc619e4e1614c94d19cc9d12bbe7f7826cbdf (patch)
treeb165ff3ec49f2215f205bdc8abafbe3eb6d3949b /actionpack/test
parent593fe4312fc15fba458cf14e1154eeb8a8ded37c (diff)
parent3d1095563c7d6f3e32bddbf9008607d921061e58 (diff)
downloadrails-3ccbc619e4e1614c94d19cc9d12bbe7f7826cbdf.tar.gz
rails-3ccbc619e4e1614c94d19cc9d12bbe7f7826cbdf.tar.bz2
rails-3ccbc619e4e1614c94d19cc9d12bbe7f7826cbdf.zip
Merge pull request #4849 from carlosantoniodasilva/checkbox-hidden-form
Replicate :form html5 attribute to hidden field for check_box
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_helper_test.rb13
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