Fix missing checkout_state_path

This commit is contained in:
Matt-Yorkley
2023-06-02 14:22:18 +01:00
committed by Filipe
parent 345f540723
commit 5487aa19fc
3 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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