diff --git a/lib/insert/insert_recurring_donation.rb b/lib/insert/insert_recurring_donation.rb index acdd2a16..4aee3584 100644 --- a/lib/insert/insert_recurring_donation.rb +++ b/lib/insert/insert_recurring_donation.rb @@ -94,7 +94,7 @@ module InsertRecurringDonation InsertDonation.update_donation_keys(result) if result['payment'] - DonorDirectDebitNotificationJob.perform_later(Donation.find(result['donation']['id']), locale_for_supporter(result['donation']['supporter_id']); + DonorDirectDebitNotificationJob.perform_later(Donation.find(result['donation']['id']), locale_for_supporter(result['donation']['supporter_id'])); WeMoveExecuteForDonationsJob.perform_later(result['donation']) diff --git a/spec/support/contexts/shared_rd_donation_value_context.rb b/spec/support/contexts/shared_rd_donation_value_context.rb index 8f367cc4..67d65ec1 100644 --- a/spec/support/contexts/shared_rd_donation_value_context.rb +++ b/spec/support/contexts/shared_rd_donation_value_context.rb @@ -370,8 +370,9 @@ RSpec.shared_context :shared_rd_donation_value_context do end def before_each_sepa_success - expect { + expect(InsertDonation).to receive(:insert_donation).and_wrap_original do |m, *args| + expect { expect { result = m.call(*args) }.to have_enqueued_job(DirectDebitCreateJob).with(result.id, supporter.local)