From 122577b11b1575257001fff38f442cdb191909ac Mon Sep 17 00:00:00 2001 From: Nihal Mohammed Date: Fri, 14 May 2021 02:47:23 +0530 Subject: [PATCH 1/2] Checkout made to redirect to shop front when OC closed --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8ecb68d388..55e5736dca 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -153,7 +153,7 @@ class ApplicationController < ActionController::Base current_order.empty! current_order.set_order_cycle! nil flash[:info] = I18n.t('order_cycle_closed') - redirect_to main_app.root_url + redirect_to main_app.shop_path end end From 0b12b398bac124947c5feb2a57eed6a7c41bb0b1 Mon Sep 17 00:00:00 2001 From: Nihal Mohammed Date: Fri, 14 May 2021 03:32:14 +0530 Subject: [PATCH 2/2] Update spec test for the changed redirect path --- spec/controllers/base_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/base_controller_spec.rb b/spec/controllers/base_controller_spec.rb index 2f82f52e7d..02b68b3750 100644 --- a/spec/controllers/base_controller_spec.rb +++ b/spec/controllers/base_controller_spec.rb @@ -100,7 +100,7 @@ describe BaseController, type: :controller do end end - it "redirects to home with message if order cycle is expired" do + it "redirects to shopfront with message if order cycle is expired" do expect(controller).to receive(:current_order_cycle).and_return(oc) expect(controller).to receive(:current_order).and_return(order).twice expect(oc).to receive(:closed?).and_return(true) @@ -109,7 +109,7 @@ describe BaseController, type: :controller do get :index - expect(response).to redirect_to root_url + expect(response).to redirect_to shop_url expect(flash[:info]).to eq I18n.t('order_cycle_closed') end end