aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 18:21:54 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 18:21:54 +0000
commit9686dcdb5b0cefe2ab80ac457917025848afb9b3 (patch)
tree84df465aa201d46605dfee61e69f03cfc1a670cd /actionpack/test/template/text_helper_test.rb
parent286bd9b9f064fbfb67a9518f8b5216d03c496312 (diff)
downloadrails-9686dcdb5b0cefe2ab80ac457917025848afb9b3.tar.gz
rails-9686dcdb5b0cefe2ab80ac457917025848afb9b3.tar.bz2
rails-9686dcdb5b0cefe2ab80ac457917025848afb9b3.zip
Fixed TextHelper#word_wrap for multiline strings with extra carrier returns (closes #8663) [seth]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7562 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 1e80d030ec..822b88adee 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -120,6 +120,10 @@ class TextHelperTest < Test::Unit::TestCase
assert_equal("my very very\nvery long\nstring", word_wrap("my very very very long string", 15))
end
+ def test_word_wrap_with_extra_newlines
+ assert_equal("my very very\nvery long\nstring\n\nwith another\nline", word_wrap("my very very very long string\n\nwith another line", 15))
+ end
+
def test_pluralization
assert_equal("1 count", pluralize(1, "count"))
assert_equal("2 counts", pluralize(2, "count"))