Sha256: c30e0a3cbec39e2a26f3b7c06b0378d54f12fa2b5bc4759a377c053bc1c96bfa
Contents?: true
Size: 769 Bytes
Versions: 62
Compression:
Stored size: 769 Bytes
Contents
require 'test_helper' module Workarea module Storefront class RefundViewModelTest < TestCase def test_tenders order = create_placed_order payment = Payment.find(order.id) amounts = payment.tenders.reduce({}) { |m, t| m.merge(t.id => t.amount) } Payment::Capture.new(payment: payment, amounts: amounts).complete! refund = Payment::Refund .new(payment: payment, amounts: amounts) .tap(&:complete!) view_model = RefundViewModel.wrap(refund) assert_equal(1, view_model.tenders.size) assert_equal(payment.credit_card, view_model.tenders.keys.first) assert_equal(payment.credit_card.amount, view_model.tenders.values.first) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems