summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-18 10:47:18 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-18 10:47:23 -0500
commit110f5a16547865156c5cae10d0d6171dab442029 (patch)
tree583a235f2ea915a25d7ecbae172ff19725196a6a /spec
parentb46b52af37fd8c800e8fdca5de25be31415c7d5d (diff)
downloadgitlab-ce-110f5a16547865156c5cae10d0d6171dab442029.tar.gz
Catch all URI errors in ExternalLinkFilterdm-catch-uri-errors
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/banzai/filter/external_link_filter_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/external_link_filter_spec.rb b/spec/lib/banzai/filter/external_link_filter_spec.rb
index 6f6c215be87..0f8ec8de7a0 100644
--- a/spec/lib/banzai/filter/external_link_filter_spec.rb
+++ b/spec/lib/banzai/filter/external_link_filter_spec.rb
@@ -55,6 +55,13 @@ describe Banzai::Filter::ExternalLinkFilter, lib: true do
expect(doc.to_html).to eq(expected)
end
+
+ it 'skips improperly formatted mailtos' do
+ doc = filter %q(<p><a href="mailto://jblogs@example.com">Email</a></p>)
+ expected = %q(<p><a href="mailto://jblogs@example.com">Email</a></p>)
+
+ expect(doc.to_html).to eq(expected)
+ end
end
context 'for links with a username' do