Skip to content

Commit

Permalink
Merge pull request #21821 from akshay-vishnoi/fix-test-cases
Browse files Browse the repository at this point in the history
Add test cases for text_field_tag
  • Loading branch information
kaspth committed Sep 30, 2015
2 parents 8f8b7ae + c293eca commit 023aca2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion actionview/test/template/form_tag_helper_test.rb
Expand Up @@ -351,12 +351,18 @@ def test_text_field_tag_maxlength_string
assert_dom_equal expected, actual
end

def test_text_field_disabled
def test_text_field_tag_disabled
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

def test_text_field_tag_with_placeholder_option
actual = text_field_tag "title", "Hello!", placeholder: 'Enter search term...'
expected = %(<input id="title" name="title" placeholder="Enter search term..." type="text" value="Hello!" />)
assert_dom_equal expected, actual
end

def test_text_field_tag_with_multiple_options
actual = text_field_tag "title", "Hello!", :size => 70, :maxlength => 80
expected = %(<input id="title" name="title" size="70" maxlength="80" type="text" value="Hello!" />)
Expand Down

0 comments on commit 023aca2

Please sign in to comment.