summaryrefslogtreecommitdiff
path: root/spec/lib/banzai
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-06-21 09:26:26 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-06-21 09:26:26 +0000
commit94da20fde1a08c8c35c1de350b31f30185a9007b (patch)
tree92d0a2753ae5be2ccb2abdd44762e28826d71303 /spec/lib/banzai
parent069c95e13ff626b5975f50846e4496ac7ff5463c (diff)
parent1753efbc143d18fe0c29e33319b8779c1d03f7c6 (diff)
downloadgitlab-ce-94da20fde1a08c8c35c1de350b31f30185a9007b.tar.gz
Merge branch 'dm-label-reference-period' into 'master'
Properly detect label reference if followed by period or question mark See merge request gitlab-org/gitlab-ce!19965
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r--spec/lib/banzai/filter/label_reference_filter_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/lib/banzai/filter/label_reference_filter_spec.rb b/spec/lib/banzai/filter/label_reference_filter_spec.rb
index b30f3661e70..00257ed7904 100644
--- a/spec/lib/banzai/filter/label_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/label_reference_filter_spec.rb
@@ -148,9 +148,11 @@ describe Banzai::Filter::LabelReferenceFilter do
expect(doc.text).to eq 'See ?g.fm&'
end
- it 'links with adjacent text' do
- doc = reference_filter("Label (#{reference}).")
- expect(doc.to_html).to match(%r(\(<a.+><span.+>\?g\.fm&amp;</span></a>\)\.))
+ it 'does not include trailing punctuation', :aggregate_failures do
+ ['.', ', ok?', '...', '?', '!', ': is that ok?'].each do |trailing_punctuation|
+ doc = filter("Label #{reference}#{trailing_punctuation}")
+ expect(doc.to_html).to match(%r(<a.+><span.+>\?g\.fm&amp;</span></a>#{Regexp.escape(trailing_punctuation)}))
+ end
end
it 'ignores invalid label names' do