From f20d64ede0bbeb0bf2c485d648080e89c704bcf4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 7 Feb 2013 16:35:56 +0900 Subject: [PATCH] Rails 4 does not render default cols and rows options for textarea see: https://github.com/rails/rails/commit/3384ee2 --- test/helper_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/helper_test.rb b/test/helper_test.rb index fa3b324f..635b3cb4 100644 --- a/test/helper_test.rb +++ b/test/helper_test.rb @@ -132,7 +132,18 @@ HTML HAML end - if ((ActionPack::VERSION::MAJOR == 3) && (ActionPack::VERSION::MINOR >= 2) && (ActionPack::VERSION::TINY >= 3) || (ActionPack::VERSION::MAJOR == 4)) + if ActionPack::VERSION::MAJOR == 4 + def test_text_area + assert_equal(%(\n), + render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view)) + + assert_equal(%(\n), + render('= text_area :post, :body', :action_view)) + + assert_equal(%(
Foo bar
   baz
\n), + render('= content_tag "pre", "Foo bar\n baz"', :action_view)) + end + elsif (ActionPack::VERSION::MAJOR == 3) && (ActionPack::VERSION::MINOR >= 2) && (ActionPack::VERSION::TINY >= 3) def test_text_area assert_equal(%(\n), render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view))