diff --git a/spec/models/spree/payment_method/taler_spec.rb b/spec/models/spree/payment_method/taler_spec.rb index 0b0ff7eaf9..d5f0759801 100644 --- a/spec/models/spree/payment_method/taler_spec.rb +++ b/spec/models/spree/payment_method/taler_spec.rb @@ -83,6 +83,10 @@ RSpec.describe Spree::PaymentMethod::Taler do "taler://refund/backend.demo.taler.net/instances/sandbox/taler-order-8/" } + before do + stub_request(:post, token_url).to_return(body: { token: "12345" }.to_json) + end + it "starts the refund process" do order_status = { order_status: "paid" } stub_request(:get, order_endpoint).to_return(body: order_status.to_json) diff --git a/spec/system/admin/payments_taler_spec.rb b/spec/system/admin/payments_taler_spec.rb index 38a5da9792..1f8c8dd485 100644 --- a/spec/system/admin/payments_taler_spec.rb +++ b/spec/system/admin/payments_taler_spec.rb @@ -59,8 +59,10 @@ RSpec.describe "Admin -> Order -> Payments" do amount: "KUDOS:2", } } + token_endpoint = "https://taler.example.com/private/token" order_endpoint = "https://taler.example.com/private/orders/taler-id-1" refund_endpoint = "https://taler.example.com/private/orders/taler-id-1/refund" + stub_request(:post, token_endpoint).to_return(body: { token: "abc" }.to_json) stub_request(:get, order_endpoint).to_return(body: order_status.to_json) stub_request(:post, refund_endpoint).to_return(body: "{}")