gitlab-org--gitlab-foss/spec/lib/gitlab/other_markup_spec.rb
Robert Speicher 99996b6bc7 Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline

See merge request !2098
2017-05-10 16:44:20 +02:00

24 lines
542 B
Ruby

require 'spec_helper'
describe Gitlab::OtherMarkup, lib: true do
let(:context) { {} }
context "XSS Checks" do
links = {
'links' => {
file: 'file.rdoc',
input: 'XSS[JaVaScriPt:alert(1)]',
output: "\n" + '<p><a>XSS</a></p>' + "\n"
}
}
links.each do |name, data|
it "does not convert dangerous #{name} into HTML" do
expect(render(data[:file], data[:input], context)).to eq(data[:output])
end
end
end
def render(*args)
described_class.render(*args)
end
end