Commit 36d910a8 authored by Sean Arnold's avatar Sean Arnold

Tweak specs and remove label return

parent 084cd09f
......@@ -18,8 +18,6 @@ module IncidentManagement
incident.labels << label
add_resource_event
label
end
private
......
......@@ -21,20 +21,18 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
incident.labels << label
end
it 'does not add a label' do
it 'does not add a label', :aggregate_failures do
expect { subject }.not_to change { incident.labels.reload.count }
expect(incident.labels.reload).to include(label)
end
end
it 'adds a label to the incident' do
it 'adds a label to the incident', :aggregate_failures do
expect { perform }.to change { incident.labels.reload.count }.by(1)
expected_label = project.labels.find_by!(IncidentManagement::CreateIncidentSlaExceededLabelService::LABEL_PROPERTIES)
expect(perform).to eq(expected_label)
expect(incident.labels.reload).to include(label)
end
it 'adds a note that the label was added' do
it 'adds a note that the label was added', :aggregate_failures do
expect { subject }.to change { incident.resource_label_events.reload.count }
event = incident.resource_label_events.first
......
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