Sha256: a261b3a7175c59c8f6cca0461f2892564eddd0b66bb5c706a43465d8de720e44
Contents?: true
Size: 1.33 KB
Versions: 3
Compression:
Stored size: 1.33 KB
Contents
module Workarea decorate CancelOrderTest, with: :cim do def test_refunding_payment @order.update_attributes!(email: 'test@workarea.com') profile = create_payment_profile(store_credit: 6.to_m) payment = create_payment(id: @order.id, profile: profile) travel_to 2.days.ago do payment.set_address( first_name: 'Ben', last_name: 'Crouse', street: '22 S. 3rd St.', city: 'Philadelphia', region: 'PA', postal_code: '19106', country: 'US', phone_number: '2159251800' ) payment.set_store_credit payment.set_credit_card( number: '1', month: 1, year: Time.current.year + 1, cvv: '999', amount: 5.to_m ) payment.adjust_tender_amounts(11.to_m) payment.purchase! end Payment::Refund.new( payment: payment, amounts: { payment.store_credit.id => 3.to_m } ).complete! cancel = CancelOrder.new(@order) result = cancel.refund assert_equal(2, Payment::Refund.count) assert_equal( Money.mongoize(3.to_m), result.amounts[payment.store_credit.id.to_s] ) assert_equal( Money.mongoize(5.to_m), result.amounts[payment.credit_card.id.to_s] ) end end end
Version data entries
3 entries across 3 versions & 1 rubygems