mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix specs
This commit is contained in:
@@ -63,15 +63,16 @@ RSpec.describe PaymentGateways::StripeController do
|
||||
expect(controller).to receive(:current_order_cycle).and_return(order_cycle)
|
||||
expect(controller).to receive(:current_order).and_return(order).at_least(:once)
|
||||
expect(order_cycle).to receive(:closed?).and_return(true)
|
||||
expect(order).to receive(:empty!)
|
||||
expect(order).to receive(:assign_order_cycle!).with(nil)
|
||||
expect(order).not_to receive(:empty!)
|
||||
expect(order).not_to receive(:assign_order_cycle!).with(nil)
|
||||
|
||||
get :confirm, params: { payment_intent: "pi_123" }
|
||||
|
||||
expect(response).to redirect_to shop_url
|
||||
expect(flash[:info]).to eq(
|
||||
"The order cycle you've selected has just closed. Please try again!"
|
||||
)
|
||||
message = "The order cycle you've selected has just closed. " \
|
||||
"Please contact us to complete your order ##{order.number}!"
|
||||
|
||||
expect(response).to redirect_to shops_url
|
||||
expect(flash[:info]).to eq(message)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user