Fix some quirky test issues with non-reloaded entities

This commit is contained in:
Eric Schultz 2019-01-28 15:52:37 -06:00 committed by Luis Castro
parent 964aadbfb1
commit cc24183cb9
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
2 changed files with 10 additions and 0 deletions

View file

@ -23,6 +23,11 @@ describe UpdateCharges do
let!(:refunds) { [force_create(:refund, charge: charges.last, payment: reverse_payment_for_refund, disbursed: true)]} let!(:refunds) { [force_create(:refund, charge: charges.last, payment: reverse_payment_for_refund, disbursed: true)]}
before(:each) { before(:each) {
UpdateCharges.reverse_disburse_all_with_payments([payment_to_reverse.id, payment_to_reverse_2.id, payment_to_reverse_with_refund.id, reverse_payment_for_refund.id]) UpdateCharges.reverse_disburse_all_with_payments([payment_to_reverse.id, payment_to_reverse_2.id, payment_to_reverse_with_refund.id, reverse_payment_for_refund.id])
payment_to_reverse.reload
payment_to_reverse_2.reload
payment_to_reverse_with_refund.reload
payment_to_ignore.reload
} }
it 'reverses payments it should' do it 'reverses payments it should' do

View file

@ -65,6 +65,11 @@ describe UpdatePayouts do
payout.payments.push(payment_to_reverse_with_refund) payout.payments.push(payment_to_reverse_with_refund)
payout.payments.push(reverse_payment_for_refund) payout.payments.push(reverse_payment_for_refund)
UpdatePayouts.reverse_with_stripe(payout.id, bad_status, bad_failure_message) UpdatePayouts.reverse_with_stripe(payout.id, bad_status, bad_failure_message)
payment_to_reverse.reload
payment_to_reverse_2.reload
payment_to_reverse_with_refund.reload
reverse_payment_for_refund.reload
payment_to_ignore.reload
} }
it 'reverses proper payments' do it 'reverses proper payments' do