Extract and stub PaymentMethodFetcher

This commit is contained in:
Matt-Yorkley
2022-01-20 10:36:12 +00:00
parent ebb69d7f93
commit 8552da2377
4 changed files with 53 additions and 2 deletions

View File

@@ -196,7 +196,8 @@ describe SplitCheckoutController, type: :controller do
context "when an external payment gateway is used" do
before do
expect(controller).to receive(:selected_payment_method).at_least(:once) { payment_method }
expect(Checkout::PaymentMethodFetcher).
to receive_message_chain(:new, :call) { payment_method }
expect(payment_method).to receive(:external_gateway?) { true }
expect(payment_method).to receive(:external_payment_url) { "https://example.com/pay" }
end