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-10-29 03:08:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-29 03:08:36 +0300
commit1063cd719c0e25df43bf5d2c0ea8e22f112ed225 (patch)
tree0bdd8d0582bb9cd0d2ca5a6d3ea8ca593465a964 /spec/policies/alert_management
parent669f67690a43e9ec7b6d148c6ec1391b379fa16e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies/alert_management')
-rw-r--r--spec/policies/alert_management/http_integration_policy_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/policies/alert_management/http_integration_policy_spec.rb b/spec/policies/alert_management/http_integration_policy_spec.rb
new file mode 100644
index 00000000000..8e8348ad7f5
--- /dev/null
+++ b/spec/policies/alert_management/http_integration_policy_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe AlertManagement::HttpIntegrationPolicy, :models do
+ let(:integration) { create(:alert_management_http_integration) }
+ let(:project) { integration.project }
+ let(:user) { create(:user) }
+
+ subject(:policy) { described_class.new(user, integration) }
+
+ describe 'rules' do
+ it { is_expected.to be_disallowed :admin_operations }
+
+ context 'when maintainer' do
+ before do
+ project.add_maintainer(user)
+ end
+
+ it { is_expected.to be_allowed :admin_operations }
+ end
+ end
+end