Skip to content

Commit 3b7551c

Browse files
authored
Merge pull request #113 from flavorjones/flavorjones-fix-css-scrubbing-tests
fix css scrubbing tests
2 parents d8bd426 + f59ecbc commit 3b7551c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/sanitizer_test.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ def test_should_allow_custom_tags_with_custom_attributes
271271

272272
def test_scrub_style_if_style_attribute_option_is_passed
273273
input = '<p style="color: #000; background-image: url(http://www.ragingplatypus.com/i/cam-full.jpg);"></p>'
274-
assert_equal '<p style="color: #000;"></p>', safe_list_sanitize(input, attributes: %w(style))
274+
actual = safe_list_sanitize(input, attributes: %w(style))
275+
assert_includes(['<p style="color: #000;"></p>', '<p style="color:#000;"></p>'], actual)
275276
end
276277

277278
def test_should_raise_argument_error_if_tags_is_not_enumerable
@@ -413,7 +414,7 @@ def test_should_sanitize_img_dynsrc_lowsrc
413414
end
414415

415416
def test_should_sanitize_div_background_image_unicode_encoded
416-
raw = %(background-image:\0075\0072\006C\0028'\006a\0061\0076\0061\0073\0063\0072\0069\0070\0074\003a\0061\006c\0065\0072\0074\0028.1027\0058.1053\0053\0027\0029'\0029)
417+
raw = %(background-image:\u0075\u0072\u006C\u0028\u0027\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u003a\u0061\u006c\u0065\u0072\u0074\u0028\u0031\u0032\u0033\u0034\u0029\u0027\u0029)
417418
assert_equal '', sanitize_css(raw)
418419
end
419420

0 commit comments

Comments
 (0)