diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-03-07 18:48:06 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-03-10 20:04:01 +0100 |
commit | 37695b8aabc1386f21039b16c32541d71f0d4182 (patch) | |
tree | 1b6b3ec5dabb35507527f6d7f94ca22b843d8480 /actionview/test | |
parent | 96b8f401f58e9ed4ea41aa32a2b34850640ac0d7 (diff) | |
download | rails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.gz rails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.bz2 rails-37695b8aabc1386f21039b16c32541d71f0d4182.zip |
Let strip_tags leave HTML escaping to Rails.
Prevents double escaping errors, such as "&" becoming "&amp;".
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/sanitize_helper_test.rb | 4 |
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 |