Adapt code coming from master to the new order api with update_order!

This commit is contained in:
Luis Ramos
2021-05-14 19:39:23 +01:00
committed by Andy Brett
parent a1ac4e85ed
commit f7726e552a
3 changed files with 5 additions and 17 deletions

View File

@@ -335,7 +335,7 @@ describe Admin::BulkLineItemsController, type: :controller do
order.finalize!
order.recreate_all_fees!
order.create_tax_charge!
order.update!
order.update_order!
order.payments << create(:payment, payment_method: payment_method, amount: order.total, state: "completed")
allow(controller).to receive(:spree_current_user) { distributor.owner }
@@ -354,7 +354,7 @@ describe Admin::BulkLineItemsController, type: :controller do
expect(order.included_tax_total).to eq 1.22
expect(order.payment_state).to eq "paid"
expect(order).to receive(:update!).at_least(:once).and_call_original
expect(order).to receive(:update_order!).at_least(:once).and_call_original
expect(order).to receive(:create_tax_charge!).at_least(:once).and_call_original
spree_put :update, params
@@ -378,7 +378,7 @@ describe Admin::BulkLineItemsController, type: :controller do
expect(order.included_tax_total).to eq 1.22
expect(order.payment_state).to eq "paid"
expect(order).to receive(:update!).at_least(:once).and_call_original
expect(order).to receive(:update_order!).at_least(:once).and_call_original
expect(order).to receive(:create_tax_charge!).at_least(:once).and_call_original
spree_delete :destroy, params

View File

@@ -204,7 +204,7 @@ describe Api::V0::ShipmentsController, type: :controller do
before do
order.shipments.first.shipping_methods = [shipping_method1, shipping_method2]
order.select_shipping_method(shipping_method1.id)
order.update!
order.update_order!
order.update_columns(
payment_total: 60,
payment_state: "paid"