diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/services/incident_management | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/services/incident_management')
-rw-r--r-- | spec/services/incident_management/issuable_escalation_statuses/create_service_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/incident_management/issuable_escalation_statuses/create_service_spec.rb b/spec/services/incident_management/issuable_escalation_statuses/create_service_spec.rb new file mode 100644 index 00000000000..8fbab361ec4 --- /dev/null +++ b/spec/services/incident_management/issuable_escalation_statuses/create_service_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe IncidentManagement::IssuableEscalationStatuses::CreateService do + let_it_be(:project) { create(:project) } + + let(:incident) { create(:incident, project: project) } + let(:service) { described_class.new(incident) } + + subject(:execute) { service.execute} + + it 'creates an escalation status for the incident with no policy set' do + expect { execute }.to change { incident.reload.incident_management_issuable_escalation_status }.from(nil) + + status = incident.incident_management_issuable_escalation_status + + expect(status.policy_id).to eq(nil) + expect(status.escalations_started_at).to eq(nil) + expect(status.status_name).to eq(:triggered) + end + + context 'existing escalation status' do + let!(:existing_status) { create(:incident_management_issuable_escalation_status, issue: incident) } + + it 'exits without changing anything' do + expect { execute }.not_to change { incident.reload.incident_management_issuable_escalation_status } + end + end +end |