aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-03-07 18:48:06 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2015-03-10 20:04:01 +0100
commit37695b8aabc1386f21039b16c32541d71f0d4182 (patch)
tree1b6b3ec5dabb35507527f6d7f94ca22b843d8480 /actionview/test
parent96b8f401f58e9ed4ea41aa32a2b34850640ac0d7 (diff)
downloadrails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.gz
rails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.bz2
rails-37695b8aabc1386f21039b16c32541d71f0d4182.zip
Let strip_tags leave HTML escaping to Rails.
Prevents double escaping errors, such as "&amp;" becoming "&amp;amp;".
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/sanitize_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/sanitize_helper_test.rb b/actionview/test/template/sanitize_helper_test.rb
index e4be21be2c..efe846a7eb 100644
--- a/actionview/test/template/sanitize_helper_test.rb
+++ b/actionview/test/template/sanitize_helper_test.rb
@@ -29,6 +29,10 @@ class SanitizeHelperTest < ActionView::TestCase
assert_equal "", strip_tags("<script>")
end
+ def test_strip_tags_will_not_encode_special_characters
+ assert_equal "test\r\n\r\ntest", strip_tags("test\r\n\r\ntest")
+ end
+
def test_sanitize_is_marked_safe
assert sanitize("<html><script></script></html>").html_safe?
end