summaryrefslogtreecommitdiff
path: root/spec/finders/snippets_finder_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/finders/snippets_finder_spec.rb')
-rw-r--r--spec/finders/snippets_finder_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb
index 5af76968183..c645cbc964c 100644
--- a/spec/finders/snippets_finder_spec.rb
+++ b/spec/finders/snippets_finder_spec.rb
@@ -64,6 +64,13 @@ describe SnippetsFinder do
snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user)
snippets.should include(@snippet1, @snippet2, @snippet3)
end
+
+ it "returns only public snippets if unauthenticated user" do
+ snippets = SnippetsFinder.new.execute(nil, filter: :by_user, user: user)
+ snippets.should include(@snippet3)
+ snippets.should_not include(@snippet2, @snippet1)
+ end
+
end
context 'by_project filter' do