diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-12-22 11:18:28 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-12-22 11:18:28 +0300 |
commit | 27c95364b52f4e93054c45211010aeb22e40a2b2 (patch) | |
tree | b817a1aa7bc4416bfc4cc2e51b2856d36479faf8 /features/steps/shared/project.rb | |
parent | 36f4710301926bb853b35d9b14a60e03b42def34 (diff) |
Replace '.team << [user, role]' with 'add_role(user)' in specs
Diffstat (limited to 'features/steps/shared/project.rb')
-rw-r--r-- | features/steps/shared/project.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 5e4edaf99a6..affbccccdf9 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -4,13 +4,13 @@ module SharedProject # Create a project without caring about what it's called step "I own a project" do @project = create(:project, :repository, namespace: @user.namespace) - @project.team << [@user, :master] + @project.add_master(@user) end step "I own a project in some group namespace" do @group = create(:group, name: 'some group') @project = create(:project, namespace: @group) - @project.team << [@user, :master] + @project.add_master(@user) end step "project exists in some group namespace" do @@ -22,7 +22,7 @@ module SharedProject step 'I own project "Shop"' do @project = Project.find_by(name: "Shop") @project ||= create(:project, :repository, name: "Shop", namespace: @user.namespace) - @project.team << [@user, :master] + @project.add_master(@user) end step 'I disable snippets in project' do @@ -40,7 +40,7 @@ module SharedProject step 'I add a user to project "Shop"' do @project = Project.find_by(name: "Shop") other_user = create(:user, name: 'Alpha') - @project.team << [other_user, :master] + @project.add_master(other_user) end # Create another specific project called "Forum" @@ -49,14 +49,13 @@ module SharedProject @project ||= create(:project, :repository, name: "Forum", namespace: @user.namespace, path: 'forum_project') @project.build_project_feature @project.project_feature.save - @project.team << [@user, :master] + @project.add_master(@user) end # Create an empty project without caring about the name step 'I own an empty project' do - @project = create(:project, - name: 'Empty Project', namespace: @user.namespace) - @project.team << [@user, :master] + @project = create(:project, name: 'Empty Project', namespace: @user.namespace) + @project.add_master(@user) end step 'I visit my empty project page' do @@ -101,11 +100,11 @@ module SharedProject # ---------------------------------------- step 'I am member of a project with a guest role' do - @project.team << [@user, Gitlab::Access::GUEST] + @project.add_guest(@user) end step 'I am member of a project with a reporter role' do - @project.team << [@user, Gitlab::Access::REPORTER] + @project.add_reporter(@user) end # ---------------------------------------- @@ -245,6 +244,6 @@ module SharedProject user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore) project = Project.find_by(name: project_name) project ||= create(:project, visibility, name: project_name, namespace: user.namespace) - project.team << [user, :master] + project.add_master(user) end end |