Skip to content

Commit

Permalink
Test that capture doesn't escape twice
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Nov 2, 2010
1 parent 2c8bff3 commit a682986
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions actionpack/test/template/capture_helper_test.rb
Expand Up @@ -31,8 +31,13 @@ def test_capture_returns_nil_if_the_returned_value_is_not_a_string
end end


def test_capture_escapes_html def test_capture_escapes_html
string = @av.capture { '<strong>foo</strong><em>bar</em>' } string = @av.capture { '<em>bar</em>' }
assert_equal '&lt;strong&gt;foo&lt;/strong&gt;&lt;em&gt;bar&lt;/em&gt;', string 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 end


def test_content_for def test_content_for
Expand Down

0 comments on commit a682986

Please sign in to comment.