diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-04-12 12:37:01 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-04-12 12:55:15 +0300 |
commit | 3e831453d606a3d2eb82fddaa142f9ce52f0ac76 (patch) | |
tree | 0fcdcbd54de6d265a3d1cd7510895045bf437818 /spec/lib/banzai/filter/snippet_reference_filter_spec.rb | |
parent | 8e0e9d6dd5b8c283d16bd447ee052203590a391a (diff) |
Fix reference filters in group context
Since !18150 abstract reference filter supports also `group`
as a resource parent (not only `project`). Some reference filters,
which inherit from abstract filter, depend on parent being `project`
when checking a reference.
This patch adds explicit check of parent class to the given filters.
Diffstat (limited to 'spec/lib/banzai/filter/snippet_reference_filter_spec.rb')
-rw-r--r-- | spec/lib/banzai/filter/snippet_reference_filter_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/snippet_reference_filter_spec.rb b/spec/lib/banzai/filter/snippet_reference_filter_spec.rb index e068e02d4fc..21cf092428d 100644 --- a/spec/lib/banzai/filter/snippet_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/snippet_reference_filter_spec.rb @@ -210,5 +210,11 @@ describe Banzai::Filter::SnippetReferenceFilter do expect(result.css('a').first.attr('href')).to eq(urls.project_snippet_url(project, snippet)) end + + it 'ignores internal references' do + exp = act = "See $#{snippet.id}" + + expect(reference_filter(act, project: nil, group: create(:group)).to_html).to eq exp + end end end |