Skip to content

Commit

Permalink
[RUBY-3079] Actually refactor email service calls to pass self (the r…
Browse files Browse the repository at this point in the history
…enewing_registration) instead of the registration

and edit specs
  • Loading branch information
jjromeo committed Apr 24, 2024
1 parent d7e4fdc commit e7e515d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -316,19 +316,19 @@ def set_contact_address_as_registered_address
end

def send_renewal_pending_online_payment_email
WasteCarriersEngine::Notify::RenewalPendingOnlinePaymentEmailService.run(registration:)
WasteCarriersEngine::Notify::RenewalPendingOnlinePaymentEmailService.run(registration: self)
rescue StandardError => e
Airbrake.notify(e, registration_no: reg_identifier) if defined?(Airbrake)
end

def send_renewal_pending_checks_email
WasteCarriersEngine::Notify::RenewalPendingChecksEmailService.run(registration:)
WasteCarriersEngine::Notify::RenewalPendingChecksEmailService.run(registration: self)
rescue StandardError => e
Airbrake.notify(e, registration_no: reg_identifier) if defined?(Airbrake)
end

def send_renewal_pending_payment_email
WasteCarriersEngine::Notify::RenewalPendingPaymentEmailService.run(registration:)
WasteCarriersEngine::Notify::RenewalPendingPaymentEmailService.run(registration: self)
rescue StandardError => e
Airbrake.notify(e, registration_no: reg_identifier) if defined?(Airbrake)
end
Expand Down
Expand Up @@ -23,7 +23,7 @@ module WasteCarriersEngine

expect(Notify::RenewalPendingPaymentEmailService)
.to have_received(:run)
.with(registration: renewing_registration.registration)
.with(registration: renewing_registration)
.once
end
end
Expand Down
Expand Up @@ -49,7 +49,7 @@ module WasteCarriersEngine

expect(Notify::RenewalPendingOnlinePaymentEmailService)
.to have_received(:run)
.with(registration: renewing_registration.registration)
.with(registration: renewing_registration)
.once
end
end
Expand All @@ -68,7 +68,7 @@ module WasteCarriersEngine

expect(Notify::RenewalPendingChecksEmailService)
.to have_received(:run)
.with(registration: renewing_registration.registration)
.with(registration: renewing_registration)
.once
end
end
Expand Down

0 comments on commit e7e515d

Please sign in to comment.