diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-11-09 04:07:50 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-09 04:07:50 -0800 |
commit | 675304b478dd36eacd3bac96c9eef96890d4aa91 (patch) | |
tree | 7a84c2cb851305652bf166c49ba2dc9af9999468 /actionview/test/template/text_helper_test.rb | |
parent | 97f0d9a0dd12e7ad634815eecfeff866f64aad92 (diff) | |
parent | 881a2cc9071a3447d562ba358ccd1cf370124617 (diff) | |
download | rails-675304b478dd36eacd3bac96c9eef96890d4aa91.tar.gz rails-675304b478dd36eacd3bac96c9eef96890d4aa91.tar.bz2 rails-675304b478dd36eacd3bac96c9eef96890d4aa91.zip |
Merge pull request #12760 from pseidemann/master
fix simple_format escapes own output when sanitize is set to true
Diffstat (limited to 'actionview/test/template/text_helper_test.rb')
-rw-r--r-- | actionview/test/template/text_helper_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index c2999fcb85..c624326683 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -42,6 +42,11 @@ class TextHelperTest < ActionView::TestCase assert_equal "<p><b> test with unsafe string </b></p>", simple_format("<b> test with unsafe string </b><script>code!</script>") end + def test_simple_format_should_sanitize_input_when_sanitize_option_is_true + assert_equal '<p><b> test with unsafe string </b></p>', + simple_format('<b> test with unsafe string </b><script>code!</script>', {}, sanitize: true) + end + def test_simple_format_should_not_sanitize_input_when_sanitize_option_is_false assert_equal "<p><b> test with unsafe string </b><script>code!</script></p>", simple_format("<b> test with unsafe string </b><script>code!</script>", {}, :sanitize => false) end |