diff options
author | Sean McGivern <sean@gitlab.com> | 2019-02-05 07:16:10 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-02-05 07:16:10 +0000 |
commit | 8e38ca94b2ede968e8d2a66c059170d885d7df70 (patch) | |
tree | 9a74bc25f6d41d98750015a021c4ecf4ade70aee /spec | |
parent | 7f880007d41f0281833915b635244c03a4083b40 (diff) | |
parent | 7e25ff3047bc1dab59d30aeb6334842ad2acb100 (diff) | |
download | gitlab-ce-8e38ca94b2ede968e8d2a66c059170d885d7df70.tar.gz |
Merge branch '57227-absolute-uri-missing-hierarchical-segment' into 'master'
Fix ActionView::Template::Error: Absolute URI missing hierarchical segment
Closes #57227
See merge request gitlab-org/gitlab-ce!24908
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/banzai/filter/autolink_filter_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/autolink_filter_spec.rb b/spec/lib/banzai/filter/autolink_filter_spec.rb index 6217381c491..4972c4b4bd2 100644 --- a/spec/lib/banzai/filter/autolink_filter_spec.rb +++ b/spec/lib/banzai/filter/autolink_filter_spec.rb @@ -121,6 +121,13 @@ describe Banzai::Filter::AutolinkFilter do expect(doc.to_s).to eq("See #{link}") end + it 'does not autolink bad URLs after we remove trailing punctuation' do + link = 'http://]' + doc = filter("See #{link}") + + expect(doc.to_s).to eq("See #{link}") + end + it 'does not include trailing punctuation' do ['.', ', ok?', '...', '?', '!', ': is that ok?'].each do |trailing_punctuation| doc = filter("See #{link}#{trailing_punctuation}") |