aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 15:03:32 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 15:03:32 +0000
commit1b93da3262de157e7a1339b1b4ce3ff5c22081a5 (patch)
tree81e4e3abb3b902d62b0b3d5cea6ab5d1230d9c77 /actionpack/test/template/text_helper_test.rb
parentebf66379186db094ba94914c2aed4e6a485d4708 (diff)
downloadrails-1b93da3262de157e7a1339b1b4ce3ff5c22081a5.tar.gz
rails-1b93da3262de157e7a1339b1b4ce3ff5c22081a5.tar.bz2
rails-1b93da3262de157e7a1339b1b4ce3ff5c22081a5.zip
Added TextHelper#simple_format as a non-dependency text presentation helper.Fixed TextHelper#markdown to use blank? instead of empty? so it can deal with nil strings passed #814 [Johan Sorensen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index aba0d99699..efc66b3bd1 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -3,6 +3,12 @@ require File.dirname(__FILE__) + '/../../lib/action_view/helpers/text_helper'
class TextHelperTest < Test::Unit::TestCase
include ActionView::Helpers::TextHelper
+
+ def test_simple_format
+ assert_equal "<p>crazy\n<br /> cross\n<br /> platform linebreaks</p>", simple_format("crazy\r\n cross\r platform linebreaks")
+ assert_equal "<p>A paragraph</p>\n\n<p>and another one!</p>", simple_format("A paragraph\n\nand another one!")
+ assert_equal "<p>A paragraph\n<br /> With a newline</p>", simple_format("A paragraph\n With a newline")
+ end
def test_truncate
assert_equal "Hello World!", truncate("Hello World!", 12)