Commit c6d1148c authored by Peter Leitzen's avatar Peter Leitzen

Do not apply SLA labels for projects without license

parent c69f85f2
...@@ -9,7 +9,7 @@ module IncidentManagement ...@@ -9,7 +9,7 @@ module IncidentManagement
def perform(incident_id) def perform(incident_id)
@incident = Issue.find_by_id(incident_id) @incident = Issue.find_by_id(incident_id)
return unless incident&.supports_severity? return unless incident&.sla_available?
@project = incident&.project @project = incident&.project
return unless project return unless project
......
...@@ -16,6 +16,10 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do ...@@ -16,6 +16,10 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
subject(:perform) { worker.perform(incident.id) } subject(:perform) { worker.perform(incident.id) }
before do
stub_licensed_features(incident_sla: true)
end
context 'label exists already' do context 'label exists already' do
before do before do
incident.labels << label incident.labels << label
...@@ -50,4 +54,15 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do ...@@ -50,4 +54,15 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
expect(incident.labels.reload).to be_empty expect(incident.labels.reload).to be_empty
end end
end end
context 'without license' do
before do
stub_licensed_features(incident_sla: false)
end
it 'does not add a label', :aggregate_failures do
expect { subject }.not_to change { incident.labels.reload.count }
expect(incident.labels.reload).to be_empty
end
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