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
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-06-01 01:11:15 +0300
committerDouwe Maan <douwe@selenight.nl>2017-06-01 01:11:17 +0300
commit371ae05c15f0a523585c67cdaa15605b617ef037 (patch)
treed2db072882128c6bf3e5cfd501c5de2dd84412f7 /spec
parent322c9be816cd5cd9747a8737ec04622aa6b81e6b (diff)
Don't match email addresses or foo@bar as user references
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/banzai/filter/user_reference_filter_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/user_reference_filter_spec.rb b/spec/lib/banzai/filter/user_reference_filter_spec.rb
index 63b23dac7ed..edf3846b742 100644
--- a/spec/lib/banzai/filter/user_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/user_reference_filter_spec.rb
@@ -16,6 +16,11 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
expect(reference_filter(act).to_html).to eq(exp)
end
+ it 'ignores references with text before the @ sign' do
+ exp = act = "Hey foo#{reference}"
+ expect(reference_filter(act).to_html).to eq(exp)
+ end
+
%w(pre code a style).each do |elem|
it "ignores valid references contained inside '#{elem}' element" do
exp = act = "<#{elem}>Hey #{reference}</#{elem}>"