test/html5/test_sanitizer.rb in loofah-2.1.0.rc1 vs test/html5/test_sanitizer.rb in loofah-2.1.0.rc2
- old
+ new
@@ -249,18 +249,18 @@
end
def test_upper_case_css_property
html = "<div style=\"COLOR: BLUE; NOTAPROPERTY: RED;\">asdf</div>"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :strip).to_xml)
- assert_match /COLOR:\s*BLUE/i, sane.at_css("div")["style"]
- refute_match /NOTAPROPERTY/i, sane.at_css("div")["style"]
+ assert_match(/COLOR:\s*BLUE/i, sane.at_css("div")["style"])
+ refute_match(/NOTAPROPERTY/i, sane.at_css("div")["style"])
end
def test_many_properties_some_allowed
html = "<div style=\"background: bold notaproperty center alsonotaproperty 10px;\">asdf</div>"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :strip).to_xml)
- assert_match /bold\s+center\s+10px/, sane.at_css("div")["style"]
+ assert_match(/bold\s+center\s+10px/, sane.at_css("div")["style"])
end
def test_many_properties_non_allowed
html = "<div style=\"background: notaproperty alsonotaproperty;\">asdf</div>"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :strip).to_xml)
@@ -268,10 +268,10 @@
end
def test_svg_properties
html = "<line style='stroke-width: 10px;'></line>"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :strip).to_xml)
- assert_match /stroke-width:\s*10px/, sane.at_css("line")["style"]
+ assert_match(/stroke-width:\s*10px/, sane.at_css("line")["style"])
end
end
# <html5_license>
#