Merge pull request #7640 from apricot12/closed_OC_bheaviour

Checkout made to redirect to shop front when OC closed
This commit is contained in:
Andy Brett
2021-06-08 10:30:13 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

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

View File

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