Skip to content

Commit

Permalink
excerpt shoudn't return safe output test added
Browse files Browse the repository at this point in the history
[#4878]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information
spastorino authored and dhh committed Jun 17, 2010
1 parent a424808 commit 7240a96
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actionpack/test/template/text_helper_test.rb
Expand Up @@ -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))
Expand Down

0 comments on commit 7240a96

Please sign in to comment.