Permalink
Browse files

Test that capture doesn't escape twice

  • Loading branch information...
1 parent 2c8bff3 commit a682986d0d5788e543ad4961f815dcca70cdb128 @spastorino spastorino committed Nov 2, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 actionpack/test/template/capture_helper_test.rb
@@ -31,8 +31,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 a682986

Please sign in to comment.