Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-06-20 17:34:19 +0300
committerDouwe Maan <douwe@selenight.nl>2018-06-20 17:34:19 +0300
commit1753efbc143d18fe0c29e33319b8779c1d03f7c6 (patch)
tree2e83228add89acecfe92b213349f4250f8ce1565 /spec/lib/banzai/filter/label_reference_filter_spec.rb
parent96f8ad0683619bb852931f4005f0b83c8337e8e6 (diff)
Add spec for more examples of trailing punctuation that should be ignored
Diffstat (limited to 'spec/lib/banzai/filter/label_reference_filter_spec.rb')
-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 f34d3dc935b..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