Skip to content
Browse files

excerpt shoudn't return safe output test added

[#4878]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information...
1 parent a424808 commit 7240a960f2e515316ac4d962482f678b67b83b8c @spastorino spastorino committed with dhh Jun 17, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 actionpack/test/template/text_helper_test.rb
View
4 actionpack/test/template/text_helper_test.rb
@@ -207,6 +207,10 @@ def test_excerpt
assert_nil excerpt("This is a beautiful morning", "day")
end
+ def test_excerpt_should_not_be_html_safe
+ assert !excerpt('This is a beautiful! morning', 'beautiful', 5).html_safe?
+ end
+
def test_excerpt_in_borderline_cases
assert_equal("", excerpt("", "", 0))
assert_equal("a", excerpt("a", "a", 0))

0 comments on commit 7240a96

Please sign in to comment.
Something went wrong with that request. Please try again.