"notified #{recipients.map(&:to_reference).to_sentence} of this alert via escalation policy **#{escalation_policy.name}**"
else
"notified #{recipients.map(&:to_reference).to_sentence} of this alert via schedule **#{oncall_schedule.name}**, per an escalation rule which no longer exists"
@@ -21,5 +22,13 @@ RSpec.describe SystemNotes::EscalationsService do
it'posts the correct text to the system note'do
expect(subject.note).tomatch("notified #{user.to_reference} and #{user_2.to_reference} of this alert via escalation policy **#{escalation_policy.name}**")
end
context'when policy is missing'do
let_it_be(:escalation_policy){nil}
it'posts the correct text to the system note'do
expect(subject.note).tomatch("notified #{user.to_reference} and #{user_2.to_reference} of this alert via schedule **#{oncall_schedule.name}**, per an escalation rule which no longer exists")