Commit aa03c1ac authored by Alex Kalderimis's avatar Alex Kalderimis

Move prometheus service policy tests to service_policy_spec

parent 2de1a4ef
......@@ -2,22 +2,25 @@
require 'spec_helper'
RSpec.describe PrometheusService, :models do
let(:integration) { create(:prometheus_service) }
RSpec.describe ServicePolicy, :models do
let_it_be(:user) { create(:user) }
let(:project) { integration.project }
let(:user) { create(:user) }
subject(:policy) { Ability.policy_for(user, integration) }
describe 'rules' do
it { is_expected.to be_disallowed :admin_project }
context 'when the integration is a prometheus_service' do
let(:integration) { create(:prometheus_service) }
context 'when maintainer' do
before do
project.add_maintainer(user)
end
describe 'rules' do
it { is_expected.to be_disallowed :admin_project }
context 'when maintainer' do
before do
project.add_maintainer(user)
end
it { is_expected.to be_allowed :admin_project }
it { is_expected.to be_allowed :admin_project }
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment