diff options
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) } |