mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
Move #check_order_cycle_expiry method to OrderStockCheck and don't call it from BaseController :before_action callback
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user