File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ class UnitTestApi < Loofah::TestCase
55
55
node_set . scrub! ( :strip )
56
56
end
57
57
58
+ it "scrubs fragment nodesets" do
59
+ doc = Loofah . fragment ( HTML )
60
+ assert ( node_set = doc . css ( "div" ) )
61
+ assert_instance_of Nokogiri ::XML ::NodeSet , node_set
62
+ node_set . scrub! ( :strip )
63
+ end
64
+
58
65
it "exposes serialize_root on HTML::DocumentFragment" do
59
66
doc = Loofah . fragment ( HTML )
60
67
assert_equal HTML , doc . serialize_root . to_html
@@ -110,6 +117,13 @@ class UnitTestApi < Loofah::TestCase
110
117
assert ( node = doc . at_css ( "div" ) )
111
118
node . scrub! ( :strip )
112
119
end
120
+
121
+ it "scrubs document nodesets" do
122
+ doc = Loofah . xml_document ( XML )
123
+ assert ( node_set = doc . css ( "div" ) )
124
+ assert_instance_of Nokogiri ::XML ::NodeSet , node_set
125
+ node_set . scrub! ( :strip )
126
+ end
113
127
end
114
128
115
129
private
You can’t perform that action at this time.
0 commit comments