diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-30 21:15:18 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-30 21:15:18 +0200 |
commit | 023aca27842b26fb8061bd1298e48395f71c0049 (patch) | |
tree | a272ed5d465e4138bfc4c04db003ec59557d88fe | |
parent | 8f8b7ae1d8fd8b17674d70f5bbddabfc3629a7e7 (diff) | |
parent | c293eca83f46f9645c40b2476b71daec8b33c3e2 (diff) | |
download | rails-023aca27842b26fb8061bd1298e48395f71c0049.tar.gz rails-023aca27842b26fb8061bd1298e48395f71c0049.tar.bz2 rails-023aca27842b26fb8061bd1298e48395f71c0049.zip |
Merge pull request #21821 from akshay-vishnoi/fix-test-cases
Add test cases for text_field_tag
-rw-r--r-- | actionview/test/template/form_tag_helper_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb index 8db35d02e1..643ec15b94 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -351,12 +351,18 @@ class FormTagHelperTest < ActionView::TestCase 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!" />) |