diff options
author | Robert Speicher <robert@gitlab.com> | 2018-03-23 16:29:15 +0000 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2018-03-29 12:12:51 +0200 |
commit | 60c5c8a988d9c123fd44f69eaf0e5f80f8d2116e (patch) | |
tree | 4a25b6cfa7579bf488c98e835d18d8609e1d361b /spec | |
parent | 166d2cece967676d52ccf0c362bfe59374068eba (diff) | |
download | gitlab-ce-60c5c8a988d9c123fd44f69eaf0e5f80f8d2116e.tar.gz |
Merge branch '44587-autolinking-includes-trailing-exclamation-marks' into 'master'cherry-pick-058dd1
Resolve "Autolinking includes trailing exclamation marks"
Closes #44587
See merge request gitlab-org/gitlab-ce!17965
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/banzai/filter/autolink_filter_spec.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/lib/banzai/filter/autolink_filter_spec.rb b/spec/lib/banzai/filter/autolink_filter_spec.rb index b502daea418..cbb0089bde7 100644 --- a/spec/lib/banzai/filter/autolink_filter_spec.rb +++ b/spec/lib/banzai/filter/autolink_filter_spec.rb @@ -122,14 +122,10 @@ describe Banzai::Filter::AutolinkFilter do end it 'does not include trailing punctuation' do - doc = filter("See #{link}.") - expect(doc.at_css('a').text).to eq link - - doc = filter("See #{link}, ok?") - expect(doc.at_css('a').text).to eq link - - doc = filter("See #{link}...") - expect(doc.at_css('a').text).to eq link + ['.', ', ok?', '...', '?', '!', ': is that ok?'].each do |trailing_punctuation| + doc = filter("See #{link}#{trailing_punctuation}") + expect(doc.at_css('a').text).to eq link + end end it 'includes trailing punctuation when part of a balanced pair' do |