From a6074c34e5e27b8d2b242808b7eb4e3f3ccf5f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 27 Feb 2012 09:44:58 -0300 Subject: Add a new line after the textarea opening tag. Closes #393 --- .../lib/action_view/helpers/tags/text_area.rb | 2 +- .../test/template/active_model_helper_test.rb | 2 +- actionpack/test/template/form_helper_test.rb | 72 +++++++++++----------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/actionpack/lib/action_view/helpers/tags/text_area.rb b/actionpack/lib/action_view/helpers/tags/text_area.rb index a7db8eb437..461a049fc2 100644 --- a/actionpack/lib/action_view/helpers/tags/text_area.rb +++ b/actionpack/lib/action_view/helpers/tags/text_area.rb @@ -12,7 +12,7 @@ module ActionView options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) end - content_tag("textarea", ERB::Util.html_escape(options.delete('value') || value_before_type_cast(object)), options) + content_tag("textarea", "\n#{options.delete('value') || value_before_type_cast(object)}", options) end end end diff --git a/actionpack/test/template/active_model_helper_test.rb b/actionpack/test/template/active_model_helper_test.rb index 52be0f1762..66a7bce71e 100644 --- a/actionpack/test/template/active_model_helper_test.rb +++ b/actionpack/test/template/active_model_helper_test.rb @@ -29,7 +29,7 @@ class ActiveModelHelperTest < ActionView::TestCase def test_text_area_with_errors assert_dom_equal( - %(
), + %(
), text_area("post", "body") ) end diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 63970d0a89..4eed5615f6 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -474,7 +474,7 @@ class FormHelperTest < ActionView::TestCase def test_text_area assert_dom_equal( - '', + %{}, text_area("post", "body") ) end @@ -482,14 +482,14 @@ class FormHelperTest < ActionView::TestCase def test_text_area_with_escapes @post.body = "Back to the hill and over it again!" assert_dom_equal( - '', + %{}, text_area("post", "body") ) end def test_text_area_with_alternate_value assert_dom_equal( - '', + %{}, text_area("post", "body", :value => 'Testing alternate values.') ) end @@ -497,14 +497,14 @@ class FormHelperTest < ActionView::TestCase def test_text_area_with_html_entities @post.body = "The HTML Entity for & is &" assert_dom_equal( - '', + %{}, text_area("post", "body") ) end def test_text_area_with_size_option assert_dom_equal( - '', + %{}, text_area("post", "body", :size => "183x820") ) end @@ -574,7 +574,7 @@ class FormHelperTest < ActionView::TestCase '', text_field("post", "title", "name" => "dont guess") ) assert_dom_equal( - '', + %{}, text_area("post", "body", "name" => "really!") ) assert_dom_equal( @@ -594,7 +594,7 @@ class FormHelperTest < ActionView::TestCase '', text_field("post", "title", "id" => "dont guess") ) assert_dom_equal( - '', + %{}, text_area("post", "body", "id" => "really!") ) assert_dom_equal( @@ -614,7 +614,7 @@ class FormHelperTest < ActionView::TestCase '', text_field("post", "title", "id" => nil) ) assert_dom_equal( - '', + %{}, text_area("post", "body", "id" => nil) ) assert_dom_equal( @@ -645,7 +645,7 @@ class FormHelperTest < ActionView::TestCase text_field("post", "title", "index" => 5) ) assert_dom_equal( - '', + %{}, text_area("post", "body", "index" => 5) ) assert_dom_equal( @@ -672,7 +672,7 @@ class FormHelperTest < ActionView::TestCase text_field("post", "title", "index" => 5, 'id' => nil) ) assert_dom_equal( - '', + %{}, text_area("post", "body", "index" => 5, 'id' => nil) ) assert_dom_equal( @@ -703,7 +703,7 @@ class FormHelperTest < ActionView::TestCase "", text_field("post[]","title") ) assert_dom_equal( - "", + "", text_area("post[]", "body") ) assert_dom_equal( @@ -711,7 +711,7 @@ class FormHelperTest < ActionView::TestCase check_box("post[]", "secret") ) assert_dom_equal( -"", + "", radio_button("post[]", "title", "Hello World") ) assert_dom_equal("", @@ -726,7 +726,7 @@ class FormHelperTest < ActionView::TestCase text_field("post[]","title", :id => nil) ) assert_dom_equal( - "", + "", text_area("post[]", "body", :id => nil) ) assert_dom_equal( @@ -761,7 +761,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/posts/123", "create-post" , "edit_post", :method => 'patch') do "" + "" + - "" + + "" + "" + "" + "" + @@ -878,7 +878,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/posts/123", "create-post", "edit_other_name", :method => 'patch') do "" + "" + - "" + + "" + "" + "" + "" @@ -896,7 +896,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/", "create-post", "edit_post", "delete") do "" + - "" + + "" + "" + "" end @@ -913,7 +913,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/", "create-post", "edit_post", "delete") do "" + - "" + + "" + "" + "" end @@ -944,7 +944,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/", "create-post", "edit_post", :method => 'patch', :remote => true) do "" + - "" + + "" + "" + "" end @@ -961,7 +961,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/", "create-post", "edit_post", :method => 'patch', :remote => true) do "" + - "" + + "" + "" + "" end @@ -980,7 +980,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/posts", 'new_post', 'new_post', :remote => true) do "" + - "" + + "" + "" + "" end @@ -997,7 +997,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form("/", "create-post") do "" + - "" + + "" + "" + "" end @@ -1016,7 +1016,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do "" + "" + - "" + + "" + "" + "" end @@ -1033,7 +1033,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do "" + - "" + + "" + "" + "" end @@ -1050,7 +1050,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'namespace_edit_post_123', 'edit_post', 'patch') do "" + - "" + + "" + "" + "" end @@ -1110,7 +1110,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'namespace_edit_post_123', 'edit_post', 'patch') do "" + - "" + + "" + "" end @@ -1845,7 +1845,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1861,7 +1861,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1877,7 +1877,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1893,7 +1893,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1909,7 +1909,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1925,7 +1925,7 @@ class FormHelperTest < ActionView::TestCase expected = "" + - "" + + "" + "" + "" @@ -1970,7 +1970,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'create-post', 'edit_post', :method => 'patch') do "" + - "" + + "" + "" + "" end @@ -1990,7 +1990,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'create-post', 'edit_post', :method => 'patch') do "" + - "" + + "" + "" end @@ -2030,7 +2030,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do "
" + - "
" + + "
" + "
" end @@ -2049,7 +2049,7 @@ class FormHelperTest < ActionView::TestCase expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do "
" + - "
" + + "
" + "
" end @@ -2067,7 +2067,7 @@ class FormHelperTest < ActionView::TestCase expected = "
" + - "
" + + "
" + "
" assert_dom_equal expected, output_buffer -- cgit v1.2.3