blob: 523464d8ff1711a49e70071a1eb96a053ab09d51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# 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) }
subject(:policy) { described_class.new(user, alert) }
describe 'rules' do
it { is_expected.to be_disallowed :read_alert_management_alerts }
it { is_expected.to be_disallowed :update_alert_management_alerts }
context 'when developer' do
before do
project.add_developer(user)
end
it { is_expected.to be_allowed :read_alert_management_alerts }
it { is_expected.to be_allowed :update_alert_management_alerts }
end
end
end
|