aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-10-22 23:58:41 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-10-22 23:58:41 +0000
commitb34ed9b33939d5e51bde7a1233da04633ac961c1 (patch)
tree6c0af57151fc56b0f387e418dc4b83ec99e9c54d /actionpack/test
parent986c1a6240b412b89b8210a87fa64fb6981696a4 (diff)
downloadrails-b34ed9b33939d5e51bde7a1233da04633ac961c1.tar.gz
rails-b34ed9b33939d5e51bde7a1233da04633ac961c1.tar.bz2
rails-b34ed9b33939d5e51bde7a1233da04633ac961c1.zip
Docfix (closes #6393)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/text_helper_test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 8649798bc3..3be51b6379 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -16,9 +16,12 @@ class TextHelperTest < Test::Unit::TestCase
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")
- assert_equal "<p>A\n<br />B\n<br />C\n<br />D</p>", simple_format("A\nB\nC\nD")
+
+ text = "A\nB\nC\nD"
+ assert_equal "<p>A\n<br />B\n<br />C\n<br />D</p>", simple_format(text)
+ assert_equal text, "A\nB\nC\nD"
end
-
+
def test_truncate
assert_equal "Hello World!", truncate("Hello World!", 12)
assert_equal "Hello Wor...", truncate("Hello World!!", 12)
@@ -35,8 +38,7 @@ class TextHelperTest < Test::Unit::TestCase
end
def test_strip_links
- assert_equal "on my mind", strip_links("<a href='almost'>on my mind</a>")
- assert_equal "on my mind", strip_links("<A href='almost'>on my mind</A>")
+ assert_equal "on my mind\nall day long", strip_links("<a href='almost'>on my mind</a>\n<A href='almost'>all day long</A>")
end
def test_highlighter
@@ -82,7 +84,6 @@ class TextHelperTest < Test::Unit::TestCase
assert_equal("...is a beautiful morni...", excerpt("This is a beautiful morning", "beautiful", 5))
assert_equal("This is a...", excerpt("This is a beautiful morning", "this", 5))
assert_equal("...iful morning", excerpt("This is a beautiful morning", "morning", 5))
- assert_equal("...iful morning", excerpt("This is a beautiful morning", "morning", 5))
assert_nil excerpt("This is a beautiful morning", "day")
end
@@ -111,6 +112,7 @@ class TextHelperTest < Test::Unit::TestCase
assert_equal("2 counts", pluralize('2', "count"))
assert_equal("1,066 counts", pluralize('1,066', "count"))
assert_equal("1.25 counts", pluralize('1.25', "count"))
+ assert_equal("2 counters", pluralize(2, "count", "counters"))
end
def test_auto_link_parsing