mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
move subs jobs out of spree namespace
This commit is contained in:
@@ -97,7 +97,7 @@ class SubscriptionConfirmJob < ActiveJob::Base
|
||||
def send_payment_authorization_emails(order)
|
||||
order.payments.each do |payment|
|
||||
if payment.cvv_response_message.present?
|
||||
Spree::PaymentMailer.authorize_payment(payment).deliver
|
||||
PaymentMailer.authorize_payment(payment).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -282,20 +282,20 @@ describe SubscriptionConfirmJob do
|
||||
|
||||
before do
|
||||
allow(order).to receive(:payments) { [payment] }
|
||||
allow(Spree::PaymentMailer).to receive(:authorize_payment) { mail_mock }
|
||||
allow(PaymentMailer).to receive(:authorize_payment) { mail_mock }
|
||||
end
|
||||
|
||||
it "sends authorization email if a payment requires it" do
|
||||
allow(payment).to receive(:cvv_response_message) { "http://redirect_url" }
|
||||
job.send(:send_payment_authorization_emails, order)
|
||||
expect(Spree::PaymentMailer).to have_received(:authorize_payment)
|
||||
expect(PaymentMailer).to have_received(:authorize_payment)
|
||||
expect(mail_mock).to have_received(:deliver)
|
||||
end
|
||||
|
||||
it "does not send authorization email if no payment requires it" do
|
||||
allow(payment).to receive(:cvv_response_message) { nil }
|
||||
job.send(:send_payment_authorization_emails, order)
|
||||
expect(Spree::PaymentMailer).not_to have_received(:authorize_payment)
|
||||
expect(PaymentMailer).not_to have_received(:authorize_payment)
|
||||
expect(mail_mock).not_to have_received(:deliver)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user