1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix sanitizer tests

These tests were failing due to backwards incompatible changes, as apart
of the v1.0.3 release of rails-html-sanitizer.
This commit is contained in:
Jon Moss 2016-01-26 15:43:29 -05:00
parent 534b12afb5
commit f31a386c7e

View file

@ -43,11 +43,11 @@ class TextHelperTest < ActionView::TestCase
end
def test_simple_format_should_sanitize_input_when_sanitize_option_is_not_false
assert_equal "<p><b> test with unsafe string </b></p>", simple_format("<b> test with unsafe string </b><script>code!</script>")
assert_equal "<p><b> test with unsafe string </b>code!</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>',
assert_equal '<p><b> test with unsafe string </b>code!</p>',
simple_format('<b> test with unsafe string </b><script>code!</script>', {}, sanitize: true)
end
@ -198,7 +198,7 @@ class TextHelperTest < ActionView::TestCase
def test_highlight_should_sanitize_input
assert_equal(
"This is a <mark>beautiful</mark> morning",
"This is a <mark>beautiful</mark> morningcode!",
highlight("This is a beautiful morning<script>code!</script>", "beautiful")
)
end