From 81b14b7c5c32ef1b21227f7f2548685801930201 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 21 Aug 2014 22:07:33 -0700 Subject: Revert "Add I18n support for `:placeholder` HTML option is passed to form fields" --- actionview/test/template/form_helper_test.rb | 168 --------------------------- 1 file changed, 168 deletions(-) (limited to 'actionview/test') diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb index d944214961..a9f137aec6 100644 --- a/actionview/test/template/form_helper_test.rb +++ b/actionview/test/template/form_helper_test.rb @@ -59,35 +59,6 @@ class FormHelperTest < ActionView::TestCase } } - I18n.backend.store_translations 'placeholder', { - activemodel: { - attributes: { - post: { - cost: "Total cost" - }, - :"post/cost" => { - uk: "Pounds" - } - } - }, - helpers: { - placeholder: { - post: { - title: "What is this about?", - written_on: { - spanish: "Escrito en" - }, - comments: { - body: "Write body here" - } - }, - tag: { - value: "Tag" - } - } - } - } - @post = Post.new @comment = Comment.new def @post.errors() @@ -326,68 +297,6 @@ class FormHelperTest < ActionView::TestCase ) end - def test_text_field_placeholder_without_locales - with_locale :placeholder do - assert_dom_equal('', text_field(:post, :body, placeholder: true)) - end - end - - def test_text_field_placeholder_with_locales - with_locale :placeholder do - assert_dom_equal('', text_field(:post, :title, placeholder: true)) - end - end - - def test_text_field_placeholder_with_human_attribute_name - with_locale :placeholder do - assert_dom_equal('', text_field(:post, :cost, placeholder: true)) - 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")) - 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")) - end - end - - def test_text_field_placeholder_with_locales_and_nested_attributes - with_locale :placeholder do - form_for(@post, html: { id: 'create-post' }) do |f| - f.fields_for(:comments) do |cf| - concat cf.text_field(:body, placeholder: true) - end - end - - expected = whole_form("/posts/123", "create-post", "edit_post", method: "patch") do - '' - end - - assert_dom_equal expected, output_buffer - end - end - - def test_text_field_placeholder_with_locales_fallback_and_nested_attributes - with_locale :placeholder do - form_for(@post, html: { id: 'create-post' }) do |f| - f.fields_for(:tags) do |cf| - concat cf.text_field(:value, placeholder: true) - end - end - - expected = whole_form("/posts/123", "create-post", "edit_post", method: "patch") do - '' - end - - assert_dom_equal expected, output_buffer - end - end - def test_text_field assert_dom_equal( '', @@ -756,83 +665,6 @@ class FormHelperTest < ActionView::TestCase ) end - def test_text_area_placeholder_without_locales - with_locale :placeholder do - assert_dom_equal( - %{}, - text_area(:post, :body, placeholder: true) - ) - end - end - - def test_text_area_placeholder_with_locales - with_locale :placeholder do - assert_dom_equal( - %{}, - text_area(:post, :title, placeholder: true) - ) - end - end - - def test_text_area_placeholder_with_human_attribute_name - with_locale :placeholder do - assert_dom_equal( - %{}, - text_area(:post, :cost, placeholder: true) - ) - 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") - ) - end - end - - def test_text_area_placeholder_with_locales_and_value - with_locale :placeholder do - assert_dom_equal( - %{}, - text_area(:post, :written_on, placeholder: "spanish") - ) - end - end - - def test_text_area_placeholder_with_locales_and_nested_attributes - with_locale :placeholder do - form_for(@post, html: { id: 'create-post' }) do |f| - f.fields_for(:comments) do |cf| - concat cf.text_area(:body, placeholder: true) - end - end - - expected = whole_form("/posts/123", "create-post", "edit_post", method: "patch") do - %{} - end - - assert_dom_equal expected, output_buffer - end - end - - def test_text_area_placeholder_with_locales_fallback_and_nested_attributes - with_locale :placeholder do - form_for(@post, html: { id: 'create-post' }) do |f| - f.fields_for(:tags) do |cf| - concat cf.text_area(:value, placeholder: true) - end - end - - expected = whole_form("/posts/123", "create-post", "edit_post", method: "patch") do - %{} - end - - assert_dom_equal expected, output_buffer - end - end - def test_text_area assert_dom_equal( %{}, -- cgit v1.2.3