BigW Consortium Gitlab

Commit 46025ffb by Douwe Maan

Fix specs

parent aa4007a5
...@@ -93,16 +93,16 @@ module Gitlab::Markdown ...@@ -93,16 +93,16 @@ module Gitlab::Markdown
end end
end end
context 'when pipeline is :description' do context 'when inline_sanitization is true' do
it 'uses a stricter whitelist' do it 'uses a stricter whitelist' do
doc = filter('<h1>Description</h1>', pipeline: :description) doc = filter('<h1>Description</h1>', inline_sanitization: true)
expect(doc.to_html.strip).to eq 'Description' expect(doc.to_html.strip).to eq 'Description'
end end
%w(pre code img ol ul li).each do |elem| %w(pre code img ol ul li).each do |elem|
it "removes '#{elem}' elements" do it "removes '#{elem}' elements" do
act = "<#{elem}>Description</#{elem}>" act = "<#{elem}>Description</#{elem}>"
expect(filter(act, pipeline: :description).to_html.strip). expect(filter(act, inline_sanitization: true).to_html.strip).
to eq 'Description' to eq 'Description'
end end
end end
...@@ -110,7 +110,7 @@ module Gitlab::Markdown ...@@ -110,7 +110,7 @@ module Gitlab::Markdown
%w(b i strong em a ins del sup sub p).each do |elem| %w(b i strong em a ins del sup sub p).each do |elem|
it "still allows '#{elem}' elements" do it "still allows '#{elem}' elements" do
exp = act = "<#{elem}>Description</#{elem}>" exp = act = "<#{elem}>Description</#{elem}>"
expect(filter(act, pipeline: :description).to_html).to eq exp expect(filter(act, inline_sanitization: true).to_html).to eq exp
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment