mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix missing checkout_state_path
This commit is contained in:
@@ -29,11 +29,11 @@ module PaymentGateways
|
||||
flash[:error] =
|
||||
Spree.t('flash.generic_error', scope: 'paypal',
|
||||
reasons: pp_response.errors.map(&:long_message).join(" "))
|
||||
redirect_to main_app.checkout_state_path(:payment)
|
||||
redirect_to main_app.checkout_step_path(:payment)
|
||||
end
|
||||
rescue SocketError
|
||||
flash[:error] = Spree.t('flash.connection_failed', scope: 'paypal')
|
||||
redirect_to main_app.checkout_state_path(:payment)
|
||||
redirect_to main_app.checkout_step_path(:payment)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ module Spree
|
||||
format.html do
|
||||
if params.key?(:checkout)
|
||||
@order.next_transition.run_callbacks if @order.cart?
|
||||
redirect_to main_app.checkout_state_path(@order.checkout_steps.first)
|
||||
redirect_to main_app.checkout_step_path(@order.checkout_steps.first)
|
||||
elsif @order.complete?
|
||||
redirect_to main_app.order_path(@order)
|
||||
else
|
||||
|
||||
@@ -88,8 +88,8 @@ module PaymentGateways
|
||||
context "when processing fails" do
|
||||
let(:response) { false }
|
||||
|
||||
it "redirects to checkout_state_path with a flash error" do
|
||||
expect(post(:express)).to redirect_to checkout_state_path(:payment)
|
||||
it "redirects to checkout_step_path with a flash error" do
|
||||
expect(post(:express)).to redirect_to checkout_step_path(:payment)
|
||||
expect(flash[:error]).to eq "PayPal failed. "
|
||||
end
|
||||
end
|
||||
@@ -99,8 +99,8 @@ module PaymentGateways
|
||||
allow(response_mock).to receive(:success?).and_raise(SocketError)
|
||||
end
|
||||
|
||||
it "redirects to checkout_state_path with a flash error" do
|
||||
expect(post(:express)).to redirect_to checkout_state_path(:payment)
|
||||
it "redirects to checkout_step_path with a flash error" do
|
||||
expect(post(:express)).to redirect_to checkout_step_path(:payment)
|
||||
expect(flash[:error]).to eq "Could not connect to PayPal."
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user