Permalink
Browse files

Test that capture doesn't escape twice

  • Loading branch information...
1 parent 72d12d9 commit 3c7215bdce30aaaa6b86f5ec905c981346e170eb @spastorino spastorino committed Nov 2, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 actionpack/test/template/capture_helper_test.rb
@@ -29,8 +29,13 @@ def test_capture_returns_nil_if_the_returned_value_is_not_a_string
end
def test_capture_escapes_html
- string = @av.capture { '<strong>foo</strong><em>bar</em>' }
- assert_equal '&lt;strong&gt;foo&lt;/strong&gt;&lt;em&gt;bar&lt;/em&gt;', string
+ string = @av.capture { '<em>bar</em>' }
+ assert_equal '&lt;em&gt;bar&lt;/em&gt;', string
+ end
+
+ def test_capture_doesnt_escape_twice
+ string = @av.capture { '&lt;em&gt;bar&lt;/em&gt;'.html_safe }
+ assert_equal '&lt;em&gt;bar&lt;/em&gt;', string
end
def test_content_for

0 comments on commit 3c7215b

Please sign in to comment.