diff options
author | Prakash Laxkar <prakashlaxkar@gmail.com> | 2015-10-01 08:41:34 +0530 |
---|---|---|
committer | Prakash Laxkar <prakashlaxkar@gmail.com> | 2015-10-01 08:43:14 +0530 |
commit | 0c5c88243bc007f5a4573b3fc39e6e4e6d95b3ae (patch) | |
tree | a4f0493d187942c6c20cbe508f06768ef7f670b1 /actionview/test/template | |
parent | 0ecb32c838b853c35d7939cacde9e5fe715419f9 (diff) | |
download | rails-0c5c88243bc007f5a4573b3fc39e6e4e6d95b3ae.tar.gz rails-0c5c88243bc007f5a4573b3fc39e6e4e6d95b3ae.tar.bz2 rails-0c5c88243bc007f5a4573b3fc39e6e4e6d95b3ae.zip |
Add test cases for checkbox_tag
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/form_tag_helper_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb index 643ec15b94..de1eb89dc5 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -64,6 +64,18 @@ class FormTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_check_box_tag_disabled + actual = check_box_tag "admin","1", false, disabled: true + expected = %(<input id="admin" disabled="disabled" name="admin" type="checkbox" value="1" />) + assert_dom_equal expected, actual + end + + def test_check_box_tag_default_checked + actual = check_box_tag "admin","1", true + expected = %(<input id="admin" checked="checked" name="admin" type="checkbox" value="1" />) + assert_dom_equal expected, actual + end + def test_check_box_tag_id_sanitized label_elem = root_elem(check_box_tag("project[2][admin]")) assert_match VALID_HTML_ID, label_elem['id'] |