mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test cases for checkbox_tag
This commit is contained in:
parent
0ecb32c838
commit
0c5c88243b
1 changed files with 12 additions and 0 deletions
|
@ -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']
|
||||
|
|
Loading…
Reference in a new issue