diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-22 15:09:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-22 15:09:49 +0300 |
commit | 4b074c5f634f8e1e550107f9e8237f07878ca0e8 (patch) | |
tree | 00afed4a6853548ec97203f3f807d954180b547d /spec/policies/project_member_policy_spec.rb | |
parent | b81fd57f3d62db4455108c8de4b8d7b8d403de35 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies/project_member_policy_spec.rb')
-rw-r--r-- | spec/policies/project_member_policy_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/policies/project_member_policy_spec.rb b/spec/policies/project_member_policy_spec.rb index ab8f8b83e7f..aebbe685bb3 100644 --- a/spec/policies/project_member_policy_spec.rb +++ b/spec/policies/project_member_policy_spec.rb @@ -16,12 +16,22 @@ RSpec.describe ProjectMemberPolicy do context 'with regular member' do let(:member_user) { create(:user) } + it { is_expected.to be_allowed(:read_project) } it { is_expected.to be_allowed(:update_project_member) } it { is_expected.to be_allowed(:destroy_project_member) } it { is_expected.not_to be_allowed(:destroy_project_bot_member) } end + context 'when user is project owner' do + let(:member_user) { project.owner } + let(:member) { project.members.find_by!(user: member_user) } + + it { is_expected.to be_allowed(:read_project) } + it { is_expected.to be_disallowed(:update_project_member) } + it { is_expected.to be_disallowed(:destroy_project_member) } + end + context 'with a bot member' do let(:member_user) { create(:user, :project_bot) } |