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

Tweak specs and remove label return

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