diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b9a40dafe5..f0c8837017 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,7 +62,9 @@ class ApplicationController < ActionController::Base end def set_checkout_redirect - return unless URI(request.referer.to_s).path == main_app.checkout_path + referer_path = URI(request.referer.to_s).path + return unless referer_path == main_app.checkout_path || + referer_path == main_app.checkout_step_path(:details) session["spree_user_return_to"] = main_app.checkout_path end diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index 013e99a2fe..f59e3672ff 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -16,6 +16,8 @@ class SplitCheckoutController < ::BaseController helper 'spree/orders' helper OrderHelper + before_action :set_checkout_redirect + def edit redirect_to_step unless params[:step] end diff --git a/spec/system/consumer/shopping/checkout_auth_spec.rb b/spec/system/consumer/shopping/checkout_auth_spec.rb index 79ecdae271..2cf34e76c6 100644 --- a/spec/system/consumer/shopping/checkout_auth_spec.rb +++ b/spec/system/consumer/shopping/checkout_auth_spec.rb @@ -66,12 +66,8 @@ describe "As a consumer I want to check out my cart", js: true do end context "and populating user details on (#{checkout_type})", if: checkout_type.eql?("split_checkout") do - it "currently redirects to the homepage" do - # currently redirects to the homepage due to bug #8894 - expect(page).to have_content("Logged in successfully") - end it "should allow proceeding to the next step" do - pending("bug fix for #8894") + expect(page).to have_content("Logged in successfully") click_button "Next - Payment method" expect(page).to have_button("Next - Order summary") end