Commit 98419e98 authored by Sean Arnold's avatar Sean Arnold

Update spec style and add policy spec

parent dbb412f7
......@@ -35,8 +35,8 @@ describe Mutations::AlertManagement::UpdateAlertStatus do
allow(resolver).to receive(:resolve).and_return(alert)
end
expect(alert).to receive(:save).and_return(false)
expect(alert).to receive(:errors).and_return(
allow(alert).to receive(:save).and_return(false)
allow(alert).to receive(:errors).and_return(
double(full_messages: %w(foo bar))
)
expect(resolve).to eq(
......
......@@ -9,14 +9,15 @@ describe AlertManagement::AlertPolicy, :models do
let(:policy) { described_class.new(user, alert) }
describe 'rules' do
it { expect(policy).to be_disallowed :read_alert_management_alerts }
specify { 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 }
specify { expect(policy).to be_allowed :read_alert_management_alerts }
specify { expect(policy).to be_allowed :update_alert_management_alerts }
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