From 32b8d7201af4effc892f330848984d1f1db1ed05 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 2 Jun 2023 14:22:18 +0100 Subject: [PATCH] Fix missing checkout_state_path --- app/controllers/payment_gateways/paypal_controller.rb | 4 ++-- app/controllers/spree/orders_controller.rb | 2 +- .../payment_gateways/paypal_controller_spec.rb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/payment_gateways/paypal_controller.rb b/app/controllers/payment_gateways/paypal_controller.rb index c0c41fd77ded..ab5ed51a428b 100644 --- a/app/controllers/payment_gateways/paypal_controller.rb +++ b/app/controllers/payment_gateways/paypal_controller.rb @@ -29,11 +29,11 @@ def express 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 diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index ded1115e7542..01779e11cbc2 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -78,7 +78,7 @@ def update 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 diff --git a/spec/controllers/payment_gateways/paypal_controller_spec.rb b/spec/controllers/payment_gateways/paypal_controller_spec.rb index 79b26849e0a4..25152eb2b99a 100644 --- a/spec/controllers/payment_gateways/paypal_controller_spec.rb +++ b/spec/controllers/payment_gateways/paypal_controller_spec.rb @@ -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