mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
Merge pull request #3239 from luisramos0/2-0-ship-method-restart-checkout
[Spree Upgrade] Fix restart checkout spec
This commit is contained in:
@@ -23,7 +23,6 @@ class RestartCheckout
|
||||
end
|
||||
|
||||
def clear_shipments
|
||||
order.update_attributes!(shipping_method_id: nil)
|
||||
order.shipments.with_state(:pending).destroy_all
|
||||
end
|
||||
|
||||
|
||||
@@ -13,11 +13,10 @@ describe RestartCheckout do
|
||||
|
||||
context "when the order is in a subsequent state" do
|
||||
let!(:shipment_pending) { create(:shipment, order: order, state: 'pending') }
|
||||
let!(:payment_checkout) { create(:payment, order: order, state: 'checkout') }
|
||||
let!(:payment_failed) { create(:payment, order: order, state: 'failed') }
|
||||
let!(:payment_checkout) { create(:payment, order: order, state: 'checkout') }
|
||||
|
||||
before do
|
||||
order.shipping_method_id = shipment_pending.shipping_method_id
|
||||
order.update_attribute(:state, "payment")
|
||||
end
|
||||
|
||||
@@ -28,7 +27,6 @@ describe RestartCheckout do
|
||||
RestartCheckout.new(order).call
|
||||
|
||||
expect(order.state).to eq 'cart'
|
||||
expect(order.shipping_method_id).to eq nil
|
||||
expect(order.shipments.count).to eq 0
|
||||
expect(order.adjustments.shipping.count).to eq 0
|
||||
expect(order.payments.count).to eq 1
|
||||
|
||||
Reference in New Issue
Block a user