From f99e62e2d9e010102788f1e728f54b03f65115c5 Mon Sep 17 00:00:00 2001 From: Alex Robbin Date: Fri, 22 Aug 2014 09:54:54 -0400 Subject: just use the placeholder tag value if it is passed as a String --- actionview/test/template/form_helper_test.rb | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'actionview/test/template') diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb index d944214961..6910769183 100644 --- a/actionview/test/template/form_helper_test.rb +++ b/actionview/test/template/form_helper_test.rb @@ -344,15 +344,21 @@ class FormHelperTest < ActionView::TestCase end end + def test_text_field_placeholder_with_string_value + with_locale :placeholder do + assert_dom_equal('', text_field(:post, :cost, placeholder: "HOW MUCH?")) + end + end + def test_text_field_placeholder_with_human_attribute_name_and_value with_locale :placeholder do - assert_dom_equal('', text_field(:post, :cost, placeholder: "uk")) + assert_dom_equal('', text_field(:post, :cost, placeholder: :uk)) end end def test_text_field_placeholder_with_locales_and_value with_locale :placeholder do - assert_dom_equal('', text_field(:post, :written_on, placeholder: "spanish")) + assert_dom_equal('', text_field(:post, :written_on, placeholder: :spanish)) end end @@ -783,11 +789,20 @@ class FormHelperTest < ActionView::TestCase end end + def test_text_area_placeholder_with_string_value + with_locale :placeholder do + assert_dom_equal( + %{}, + text_area(:post, :cost, placeholder: "HOW MUCH?") + ) + end + end + def test_text_area_placeholder_with_human_attribute_name_and_value with_locale :placeholder do assert_dom_equal( %{}, - text_area(:post, :cost, placeholder: "uk") + text_area(:post, :cost, placeholder: :uk) ) end end @@ -796,7 +811,7 @@ class FormHelperTest < ActionView::TestCase with_locale :placeholder do assert_dom_equal( %{}, - text_area(:post, :written_on, placeholder: "spanish") + text_area(:post, :written_on, placeholder: :spanish) ) end end -- cgit v1.2.3