Skip to content

Commit

Permalink
add specs
Browse files Browse the repository at this point in the history
  • Loading branch information
awadyas authored and wwahammy committed May 15, 2023
1 parent 6ab8208 commit cdfbbeb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/lib/insert/insert_donation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
ObjectEvent.where(event_type: 'stripe_transaction_charge.created').count
}.by 1
end

it 'creates a subtransaction_payment whose creation date matches the legacy payment\'s date' do
expect(result['payment'].subtransaction_payment.created).to eq(result['payment'].date)
end
end

describe 'campaign donation' do
Expand All @@ -142,6 +146,10 @@
ObjectEvent.where(event_type: 'stripe_transaction_charge.created').count
}.by 1
end

it 'creates a subtransaction_payment whose creation date matches the legacy payment\'s date' do
expect(result['payment'].subtransaction_payment.created).to eq(result['payment'].date)
end
end
describe 'general donation' do
let(:result) { InsertDonation.with_stripe(amount: charge_amount, nonprofit_id: nonprofit.id, supporter_id: supporter.id, token: source_token.token, profile_id: profile.id, date: (Time.now + 1.day).to_s, dedication: 'dedication', designation: 'designation')}
Expand Down

0 comments on commit cdfbbeb

Please sign in to comment.