summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 21:08:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 21:08:37 +0000
commitbbaf2bb0438b1c71020d9d216feb528add225a7f (patch)
tree47409ddbb4994ec78c24503416ab44f129f39ec6 /spec/finders
parente9c2bf267862e22c0770cc7b3a1ed97a8b87a7fd (diff)
downloadgitlab-ce-bbaf2bb0438b1c71020d9d216feb528add225a7f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/snippets_finder_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb
index 8f83cb77709..69e03c4c473 100644
--- a/spec/finders/snippets_finder_spec.rb
+++ b/spec/finders/snippets_finder_spec.rb
@@ -284,6 +284,17 @@ describe SnippetsFinder do
expect(described_class.new(user).execute).to contain_exactly(private_personal_snippet, internal_personal_snippet, public_personal_snippet)
end
end
+
+ context 'when project snippets are disabled' do
+ it 'returns quickly' do
+ disabled_snippets_project = create(:project, :snippets_disabled)
+ finder = described_class.new(user, project: disabled_snippets_project.id)
+
+ expect(finder).not_to receive(:init_collection)
+ expect(Snippet).to receive(:none).and_call_original
+ expect(finder.execute).to be_empty
+ end
+ end
end
it_behaves_like 'snippet visibility'