summaryrefslogtreecommitdiff
path: root/spec/services/incident_management/issuable_escalation_statuses/build_service_spec.rb
blob: c20a0688ac2e18947d3d4200d37fdffd20beedfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe IncidentManagement::IssuableEscalationStatuses::BuildService do
  let_it_be(:project) { create(:project) }
  let_it_be(:incident, reload: true) { create(:incident, project: project) }

  let(:service) { described_class.new(incident) }

  subject(:execute) { service.execute }

  it_behaves_like 'initializes new escalation status with expected attributes'

  context 'with associated alert' do
    let_it_be(:alert) { create(:alert_management_alert, :acknowledged, project: project, issue: incident) }

    it_behaves_like 'initializes new escalation status with expected attributes', { status_event: :acknowledge }
  end
end