Commit 17df19e5 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'pl-fix-sla-available' into 'master'

Do not apply SLA labels for projects without license

See merge request gitlab-org/gitlab!49461
parents 3f95dd16 c6d1148c
......@@ -9,7 +9,7 @@ module IncidentManagement
def perform(incident_id)
@incident = Issue.find_by_id(incident_id)
return unless incident&.supports_severity?
return unless incident&.sla_available?
@project = incident&.project
return unless project
......
......@@ -16,6 +16,10 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
subject(:perform) { worker.perform(incident.id) }
before do
stub_licensed_features(incident_sla: true)
end
context 'label exists already' do
before do
incident.labels << label
......@@ -50,4 +54,15 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
expect(incident.labels.reload).to be_empty
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
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