Commit 355da208 authored by Rémy Coutable's avatar Rémy Coutable Committed by Robert Speicher

[EE] Extract EE-specific code from snippets_finder_spec.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent e384dd6f
......@@ -33,4 +33,21 @@ describe SnippetsFinder do
expect(results).to be_empty
end
end
context 'filter by project' do
set(:user) { create(:user) }
set(:group) { create(:group, :public) }
set(:project) { create(:project, :public, group: group) }
set(:private_project_snippet) { create(:project_snippet, :private, project: project) }
set(:internal_project_snippet) { create(:project_snippet, :internal, project: project) }
set(:public_project_snippet) { create(:project_snippet, :public, project: project) }
it 'returns all snippets for auditor users' do
user = create(:user, :auditor)
snippets = described_class.new(user, project: project).execute
expect(snippets).to include(private_project_snippet, internal_project_snippet, public_project_snippet)
end
end
end
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment