Move #check_order_cycle_expiry method to OrderStockCheck and don't call it from BaseController :before_action callback

This commit is contained in:
Matt-Yorkley
2022-01-29 12:10:55 +00:00
parent 6dac65ace5
commit 5e6dd1e6e1
5 changed files with 25 additions and 25 deletions

View File

@@ -99,17 +99,4 @@ describe BaseController, type: :controller do
controller.current_order(true)
end
end
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).at_least(:twice)
expect(oc).to receive(:closed?).and_return(true)
expect(order).to receive(:empty!)
expect(order).to receive(:set_order_cycle!).with(nil)
get :index
expect(response).to redirect_to shop_url
expect(flash[:info]).to eq I18n.t('order_cycle_closed')
end
end