Use :order_with_totals in ProcessPaymentIntent

If we just use the :order factory here, it has no line items and no total, which means when we try to push it into complete state, the #requires_payment? check fails because the order total is zero, which means the call to #process_payments is ignored
This commit is contained in:
Matt-Yorkley
2021-05-16 13:23:26 +01:00
parent fd021d4778
commit 05ed98aa0c

View File

@@ -7,7 +7,9 @@ describe ProcessPaymentIntent do
describe "processing a payment intent" do
let(:customer) { create(:customer) }
let(:order) { create(:order, customer: customer, distributor: customer.enterprise, state: "payment") }
let(:order) {
create(:order_with_totals, customer: customer, distributor: customer.enterprise, state: "payment")
}
let(:payment_method) { create(:stripe_sca_payment_method) }
let!(:payment) { create(
:payment,