mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[Fix Select tag Tests] Test correct use of multiple option for select
This commit is contained in:
parent
c27b2df561
commit
01d39787ed
1 changed files with 4 additions and 4 deletions
|
@ -210,13 +210,13 @@ class FormTagHelperTest < ActionView::TestCase
|
|||
end
|
||||
|
||||
def test_select_tag_with_multiple
|
||||
actual = select_tag "colors", "<option>Red</option><option>Blue</option><option>Green</option>".html_safe, :multiple => :true
|
||||
expected = %(<select id="colors" multiple="multiple" name="colors"><option>Red</option><option>Blue</option><option>Green</option></select>)
|
||||
actual = select_tag "colors", "<option>Red</option><option>Blue</option><option>Green</option>".html_safe, multiple: true
|
||||
expected = %(<select id="colors" multiple="multiple" name="colors[]"><option>Red</option><option>Blue</option><option>Green</option></select>)
|
||||
assert_dom_equal expected, actual
|
||||
end
|
||||
|
||||
def test_select_tag_disabled
|
||||
actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, :disabled => :true
|
||||
actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, disabled: true
|
||||
expected = %(<select id="places" disabled="disabled" name="places"><option>Home</option><option>Work</option><option>Pub</option></select>)
|
||||
assert_dom_equal expected, actual
|
||||
end
|
||||
|
@ -352,7 +352,7 @@ class FormTagHelperTest < ActionView::TestCase
|
|||
end
|
||||
|
||||
def test_text_field_disabled
|
||||
actual = text_field_tag "title", "Hello!", :disabled => :true
|
||||
actual = text_field_tag "title", "Hello!", disabled: true
|
||||
expected = %(<input id="title" name="title" disabled="disabled" type="text" value="Hello!" />)
|
||||
assert_dom_equal expected, actual
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue