diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-06-02 14:17:11 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-06-02 14:17:11 +0300 |
commit | fe78984f2045a79554ae52478d01d9102c6b6a77 (patch) | |
tree | 38ed64880315781bcf0f3bd1e1372114201c3714 /spec/lib/gitlab | |
parent | 5a1aa49b5533593dc4c6de82279fe44f5f15616c (diff) |
Actually ignore references in code blocks etc.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/reference_extractor_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index c14f4ac6bf6..951e738cb67 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -16,6 +16,26 @@ describe Gitlab::ReferenceExtractor do expect(subject.users).to eq([@u_foo, @u_bar, @u_offteam]) end + it 'ignores user mentions inside specific elements' do + @u_foo = create(:user, username: 'foo') + @u_bar = create(:user, username: 'bar') + @u_offteam = create(:user, username: 'offteam') + + project.team << [@u_foo, :reporter] + project.team << [@u_bar, :guest] + + subject.analyze(%Q{ + Inline code: `@foo` + + Code block: + + ``` + @bar + ``` + }) + expect(subject.users).to eq([]) + end + it 'accesses valid issue objects' do @i0 = create(:issue, project: project) @i1 = create(:issue, project: project) |