Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 18:09:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 18:09:29 +0300
commit37ae6b54ba524c438d1b756ce3ca29bbcec4e897 (patch)
treee0cd3b9a5f19daec493de537d3214ac390101462 /spec/policies
parentc74b7b5e4345702a1d59c72d923c3580ef157a59 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/alert_management/alert_policy_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/policies/alert_management/alert_policy_spec.rb b/spec/policies/alert_management/alert_policy_spec.rb
new file mode 100644
index 00000000000..698264e4ac7
--- /dev/null
+++ b/spec/policies/alert_management/alert_policy_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe AlertManagement::AlertPolicy, :models do
+ let(:alert) { create(:alert_management_alert) }
+ let(:project) { alert.project }
+ let(:user) { create(:user) }
+ let(:policy) { described_class.new(user, alert) }
+
+ describe 'rules' do
+ it { expect(policy).to be_disallowed :read_alert_management_alerts }
+
+ context 'when developer' do
+ before do
+ project.add_developer(user)
+ end
+
+ it { expect(policy).to be_allowed :read_alert_management_alerts }
+ end
+ end
+end