summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/controllers/projects/snippets_controller_spec.rb8
-rw-r--r--spec/requests/api/project_snippets_spec.rb4
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/controllers/projects/snippets_controller_spec.rb b/spec/controllers/projects/snippets_controller_spec.rb
index 88e4f81f232..19e948d8fb8 100644
--- a/spec/controllers/projects/snippets_controller_spec.rb
+++ b/spec/controllers/projects/snippets_controller_spec.rb
@@ -6,8 +6,8 @@ describe Projects::SnippetsController do
let(:user2) { create(:user) }
before do
- project.team << [user, :master]
- project.team << [user2, :master]
+ project.add_master(user)
+ project.add_master(user2)
end
describe 'GET #index' do
@@ -73,7 +73,7 @@ describe Projects::SnippetsController do
def create_snippet(project, snippet_params = {})
sign_in(user)
- project.team << [user, :developer]
+ project.add_developer(user)
post :create, {
namespace_id: project.namespace.to_param,
@@ -133,7 +133,7 @@ describe Projects::SnippetsController do
def mark_as_spam
admin = create(:admin)
create(:user_agent_detail, subject: snippet)
- project.team << [admin, :master]
+ project.add_master(admin)
sign_in(admin)
post :mark_as_spam,
diff --git a/spec/requests/api/project_snippets_spec.rb b/spec/requests/api/project_snippets_spec.rb
index 9e25e30bc86..45d5ae267c5 100644
--- a/spec/requests/api/project_snippets_spec.rb
+++ b/spec/requests/api/project_snippets_spec.rb
@@ -23,7 +23,7 @@ describe API::ProjectSnippets, api: true do
let(:user) { create(:user) }
it 'returns all snippets available to team member' do
- project.team << [user, :developer]
+ project.add_developer(user)
public_snippet = create(:project_snippet, :public, project: project)
internal_snippet = create(:project_snippet, :internal, project: project)
private_snippet = create(:project_snippet, :private, project: project)
@@ -76,7 +76,7 @@ describe API::ProjectSnippets, api: true do
context 'when the snippet is spam' do
def create_snippet(project, snippet_params = {})
- project.team << [user, :developer]
+ project.add_developer(user)
post api("/projects/#{project.id}/snippets", user), params.merge(snippet_params)
end