diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-12-22 19:18:28 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-12-22 19:18:28 +1100 |
commit | 27c95364b52f4e93054c45211010aeb22e40a2b2 (patch) | |
tree | b817a1aa7bc4416bfc4cc2e51b2856d36479faf8 /spec/policies | |
parent | 36f4710301926bb853b35d9b14a60e03b42def34 (diff) | |
download | gitlab-ce-27c95364b52f4e93054c45211010aeb22e40a2b2.tar.gz |
Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specs
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/ci/build_policy_spec.rb | 4 | ||||
-rw-r--r-- | spec/policies/ci/trigger_policy_spec.rb | 10 | ||||
-rw-r--r-- | spec/policies/issue_policy_spec.rb | 12 | ||||
-rw-r--r-- | spec/policies/project_snippet_policy_spec.rb | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/spec/policies/ci/build_policy_spec.rb b/spec/policies/ci/build_policy_spec.rb index 298a9d16425..41cf2ef7225 100644 --- a/spec/policies/ci/build_policy_spec.rb +++ b/spec/policies/ci/build_policy_spec.rb @@ -57,7 +57,7 @@ describe Ci::BuildPolicy do context 'team member is a guest' do before do - project.team << [user, :guest] + project.add_guest(user) end context 'when public builds are enabled' do @@ -77,7 +77,7 @@ describe Ci::BuildPolicy do context 'team member is a reporter' do before do - project.team << [user, :reporter] + project.add_reporter(user) end context 'when public builds are enabled' do diff --git a/spec/policies/ci/trigger_policy_spec.rb b/spec/policies/ci/trigger_policy_spec.rb index be40dbb2aa9..14630748c90 100644 --- a/spec/policies/ci/trigger_policy_spec.rb +++ b/spec/policies/ci/trigger_policy_spec.rb @@ -45,7 +45,7 @@ describe Ci::TriggerPolicy do context 'when user is master of the project' do before do - project.team << [user, :master] + project.add_master(user) end it_behaves_like 'allows to admin and manage trigger' @@ -53,7 +53,7 @@ describe Ci::TriggerPolicy do context 'when user is developer of the project' do before do - project.team << [user, :developer] + project.add_developer(user) end it_behaves_like 'disallows to admin and manage trigger' @@ -69,7 +69,7 @@ describe Ci::TriggerPolicy do context 'when user is master of the project' do before do - project.team << [user, :master] + project.add_master(user) end it_behaves_like 'allows to admin and manage trigger' @@ -81,7 +81,7 @@ describe Ci::TriggerPolicy do context 'when user is master of the project' do before do - project.team << [user, :master] + project.add_master(user) end it_behaves_like 'allows to manage trigger' @@ -89,7 +89,7 @@ describe Ci::TriggerPolicy do context 'when user is developer of the project' do before do - project.team << [user, :developer] + project.add_developer(user) end it_behaves_like 'disallows to admin and manage trigger' diff --git a/spec/policies/issue_policy_spec.rb b/spec/policies/issue_policy_spec.rb index be4c24c727c..a4af9361ea6 100644 --- a/spec/policies/issue_policy_spec.rb +++ b/spec/policies/issue_policy_spec.rb @@ -19,10 +19,10 @@ describe IssuePolicy do let(:issue_no_assignee) { create(:issue, project: project) } before do - project.team << [guest, :guest] - project.team << [author, :guest] - project.team << [assignee, :guest] - project.team << [reporter, :reporter] + project.add_guest(guest) + project.add_guest(author) + project.add_guest(assignee) + project.add_reporter(reporter) group.add_reporter(reporter_from_group_link) @@ -114,8 +114,8 @@ describe IssuePolicy do let(:issue_no_assignee) { create(:issue, project: project) } before do - project.team << [guest, :guest] - project.team << [reporter, :reporter] + project.add_guest(guest) + project.add_reporter(reporter) group.add_reporter(reporter_from_group_link) diff --git a/spec/policies/project_snippet_policy_spec.rb b/spec/policies/project_snippet_policy_spec.rb index f0bf46c480a..cdba1b09fc1 100644 --- a/spec/policies/project_snippet_policy_spec.rb +++ b/spec/policies/project_snippet_policy_spec.rb @@ -87,7 +87,7 @@ describe ProjectSnippetPolicy do subject { abilities(external_user, :internal) } before do - project.team << [external_user, :developer] + project.add_developer(external_user) end it do @@ -131,7 +131,7 @@ describe ProjectSnippetPolicy do subject { abilities(regular_user, :private) } before do - project.team << [regular_user, :developer] + project.add_developer(regular_user) end it do @@ -144,7 +144,7 @@ describe ProjectSnippetPolicy do subject { abilities(external_user, :private) } before do - project.team << [external_user, :developer] + project.add_developer(external_user) end it do |