Commit 2de1a4ef authored by Alex Kalderimis's avatar Alex Kalderimis

Replace prometheus service with a more general policy

This change was first made
in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40088 when
I needed to add a policy for another service. Noting that the
prometheus service thus became redundant, it is removed.
parent 29746b66
# frozen_string_literal: true
class PrometheusServicePolicy < ::BasePolicy
delegate { @subject.project }
class ServicePolicy < BasePolicy
delegate(:project)
end
......@@ -2,12 +2,12 @@
require 'spec_helper'
RSpec.describe PrometheusServicePolicy, :models do
RSpec.describe PrometheusService, :models do
let(:integration) { create(:prometheus_service) }
let(:project) { integration.project }
let(:user) { create(:user) }
subject(:policy) { described_class.new(user, integration) }
subject(:policy) { Ability.policy_for(user, integration) }
describe 'rules' do
it { is_expected.to be_disallowed :admin_project }
......
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