mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Fix infinite loop in spec
The spec was setting the order's state to "complete" but didn't save that state to the database. The new locking mechanism is was reloading the order which loaded the cart state again. And since the order.next method was mocked to just return true, the controller was trying to do that in an infinite loop.
This commit is contained in:
@@ -130,6 +130,7 @@ describe CheckoutController, type: :controller do
|
||||
context 'when completing the order' do
|
||||
before do
|
||||
order.state = 'complete'
|
||||
order.save!
|
||||
allow(order).to receive(:update_attributes).and_return(true)
|
||||
allow(order).to receive(:next).and_return(true)
|
||||
allow(order).to receive(:set_distributor!).and_return(true)
|
||||
|
||||
Reference in New Issue
Block a user