aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-11-02 20:02:55 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-02 20:02:55 -0200
commit3c7215bdce30aaaa6b86f5ec905c981346e170eb (patch)
treece1921f8e77aea37a2921c003ae3646ad965210f /actionpack/test/template
parent72d12d94559f7c124fa2ec88eb668ad2948c02f4 (diff)
downloadrails-3c7215bdce30aaaa6b86f5ec905c981346e170eb.tar.gz
rails-3c7215bdce30aaaa6b86f5ec905c981346e170eb.tar.bz2
rails-3c7215bdce30aaaa6b86f5ec905c981346e170eb.zip
Test that capture doesn't escape twice
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/capture_helper_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionpack/test/template/capture_helper_test.rb
index 25da17bde9..03050485fa 100644
--- a/actionpack/test/template/capture_helper_test.rb
+++ b/actionpack/test/template/capture_helper_test.rb
@@ -29,8 +29,13 @@ class CaptureHelperTest < ActionView::TestCase
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