Commit bb6d5af6 authored by Sean Arnold's avatar Sean Arnold

Change method signature to take keyword args

parent aca610b8
......@@ -113,7 +113,7 @@ module EE
end
def notify_via_escalation(noteable, project, recipients, escalation_policy, oncall_schedule)
escalations_service(noteable, project).notify_via_escalation(recipients, escalation_policy, oncall_schedule)
escalations_service(noteable, project).notify_via_escalation(recipients, escalation_policy: escalation_policy, oncall_schedule: oncall_schedule)
end
private
......
......@@ -8,7 +8,7 @@ module SystemNotes
@author = User.alert_bot
end
def notify_via_escalation(recipients, escalation_policy, oncall_schedule)
def notify_via_escalation(recipients, escalation_policy: nil, oncall_schedule: nil)
body = if escalation_policy
"notified #{recipients.map(&:to_reference).to_sentence} of this alert via escalation policy **#{escalation_policy.name}**"
else
......
......@@ -9,7 +9,7 @@ RSpec.describe SystemNotes::EscalationsService do
let_it_be(:author) { User.alert_bot }
describe '#notify_via_escalation' do
subject { described_class.new(noteable: noteable, project: project).notify_via_escalation([user, user_2], escalation_policy, oncall_schedule) }
subject { described_class.new(noteable: noteable, project: project).notify_via_escalation([user, user_2], escalation_policy: escalation_policy, oncall_schedule: oncall_schedule) }
let_it_be(:escalation_policy) { create(:incident_management_escalation_policy, project: project) }
let_it_be(:oncall_schedule) { create(:incident_management_oncall_schedule, project: project) }
......
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