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

Fix test_should_sanitize_illegal_style_properties failure

https://travis-ci.org/rails/rails/jobs/279300966#L2600

The result of `Loofah::HTML5::Scrub.scrub_css` was changed since
v2.1.0.rc1.

ca56295ff9
This commit is contained in:
Ryuta Kamizono 2017-09-25 07:15:52 +09:00
parent 1f87800d6a
commit ff5afbdfab

View file

@ -18,8 +18,8 @@ class SanitizeHelperTest < ActionView::TestCase
def test_should_sanitize_illegal_style_properties
raw = %(display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;)
expected = %(display: block; width: 100%; height: 100%; background-color: black; background-x: center; background-y: center;)
assert_equal expected, sanitize_css(raw)
expected = %r(\Adisplay:\s?block;\s?width:\s?100%;\s?height:\s?100%;\s?background-color:\s?black;\s?background-x:\s?center;\s?background-y:\s?center;\z)
assert_match expected, sanitize_css(raw)
end
def test_strip_tags