Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix css scrubbing tests #113

Merged
merged 3 commits into from Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/sanitizer_test.rb
Expand Up @@ -271,7 +271,8 @@ def test_should_allow_custom_tags_with_custom_attributes

def test_scrub_style_if_style_attribute_option_is_passed
input = '<p style="color: #000; background-image: url(http://www.ragingplatypus.com/i/cam-full.jpg);"></p>'
assert_equal '<p style="color: #000;"></p>', safe_list_sanitize(input, attributes: %w(style))
actual = safe_list_sanitize(input, attributes: %w(style))
assert_includes(['<p style="color: #000;"></p>', '<p style="color:#000;"></p>'], actual)
flavorjones marked this conversation as resolved.
Show resolved Hide resolved
end

def test_should_raise_argument_error_if_tags_is_not_enumerable
Expand Down Expand Up @@ -413,7 +414,7 @@ def test_should_sanitize_img_dynsrc_lowsrc
end

def test_should_sanitize_div_background_image_unicode_encoded
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)
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)
assert_equal '', sanitize_css(raw)
end

Expand Down