aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-10-01 00:23:58 +0530
committerAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-10-01 00:28:52 +0530
commitc293eca83f46f9645c40b2476b71daec8b33c3e2 (patch)
treea272ed5d465e4138bfc4c04db003ec59557d88fe /actionview
parent8f8b7ae1d8fd8b17674d70f5bbddabfc3629a7e7 (diff)
downloadrails-c293eca83f46f9645c40b2476b71daec8b33c3e2.tar.gz
rails-c293eca83f46f9645c40b2476b71daec8b33c3e2.tar.bz2
rails-c293eca83f46f9645c40b2476b71daec8b33c3e2.zip
Add test case for text_field_tag
Diffstat (limited to 'actionview')
-rw-r--r--actionview/test/template/form_tag_helper_test.rb8
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!" />)