diff options
Diffstat (limited to 'spec/policies/clusters/agents/activity_event_policy_spec.rb')
-rw-r--r-- | spec/policies/clusters/agents/activity_event_policy_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/policies/clusters/agents/activity_event_policy_spec.rb b/spec/policies/clusters/agents/activity_event_policy_spec.rb index 1262fcfd9f2..365168de79f 100644 --- a/spec/policies/clusters/agents/activity_event_policy_spec.rb +++ b/spec/policies/clusters/agents/activity_event_policy_spec.rb @@ -10,13 +10,22 @@ RSpec.describe Clusters::Agents::ActivityEventPolicy do let(:project) { event.agent.project } describe 'rules' do + context 'reporter' do + before do + project.add_reporter(user) + end + + it { expect(policy).to be_disallowed :admin_cluster } + it { expect(policy).to be_disallowed :read_cluster } + end + context 'developer' do before do project.add_developer(user) end it { expect(policy).to be_disallowed :admin_cluster } - it { expect(policy).to be_disallowed :read_cluster } + it { expect(policy).to be_allowed :read_cluster } end context 'maintainer' do |