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.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb
index c645cbc964c..1b4ffc2d717 100644
--- a/spec/finders/snippets_finder_spec.rb
+++ b/spec/finders/snippets_finder_spec.rb
@@ -18,14 +18,14 @@ describe SnippetsFinder do
it "returns all private and internal snippets" do
snippets = SnippetsFinder.new.execute(user, filter: :all)
- snippets.should include(@snippet2, @snippet3)
- snippets.should_not include(@snippet1)
+ expect(snippets).to include(@snippet2, @snippet3)
+ expect(snippets).not_to include(@snippet1)
end
it "returns all public snippets" do
snippets = SnippetsFinder.new.execute(nil, filter: :all)
- snippets.should include(@snippet3)
- snippets.should_not include(@snippet1, @snippet2)
+ expect(snippets).to include(@snippet3)
+ expect(snippets).not_to include(@snippet1, @snippet2)
end
end
@@ -38,37 +38,37 @@ describe SnippetsFinder do
it "returns all public and internal snippets" do
snippets = SnippetsFinder.new.execute(user1, filter: :by_user, user: user)
- snippets.should include(@snippet2, @snippet3)
- snippets.should_not include(@snippet1)
+ expect(snippets).to include(@snippet2, @snippet3)
+ expect(snippets).not_to include(@snippet1)
end
it "returns internal snippets" do
snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_internal")
- snippets.should include(@snippet2)
- snippets.should_not include(@snippet1, @snippet3)
+ expect(snippets).to include(@snippet2)
+ expect(snippets).not_to include(@snippet1, @snippet3)
end
it "returns private snippets" do
snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_private")
- snippets.should include(@snippet1)
- snippets.should_not include(@snippet2, @snippet3)
+ expect(snippets).to include(@snippet1)
+ expect(snippets).not_to include(@snippet2, @snippet3)
end
it "returns public snippets" do
snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_public")
- snippets.should include(@snippet3)
- snippets.should_not include(@snippet1, @snippet2)
+ expect(snippets).to include(@snippet3)
+ expect(snippets).not_to include(@snippet1, @snippet2)
end
it "returns all snippets" do
snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user)
- snippets.should include(@snippet1, @snippet2, @snippet3)
+ expect(snippets).to 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)
+ expect(snippets).to include(@snippet3)
+ expect(snippets).not_to include(@snippet2, @snippet1)
end
end
@@ -82,20 +82,20 @@ describe SnippetsFinder do
it "returns public snippets for unauthorized user" do
snippets = SnippetsFinder.new.execute(nil, filter: :by_project, project: project1)
- snippets.should include(@snippet3)
- snippets.should_not include(@snippet1, @snippet2)
+ expect(snippets).to include(@snippet3)
+ expect(snippets).not_to include(@snippet1, @snippet2)
end
it "returns public and internal snippets for none project members" do
snippets = SnippetsFinder.new.execute(user, filter: :by_project, project: project1)
- snippets.should include(@snippet2, @snippet3)
- snippets.should_not include(@snippet1)
+ expect(snippets).to include(@snippet2, @snippet3)
+ expect(snippets).not_to include(@snippet1)
end
it "returns all snippets for project members" do
project1.team << [user, :developer]
snippets = SnippetsFinder.new.execute(user, filter: :by_project, project: project1)
- snippets.should include(@snippet1, @snippet2, @snippet3)
+ expect(snippets).to include(@snippet1, @snippet2, @snippet3)
end
end
end