mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use OrderContents in BulkLineItemsController
We should move towards *all* operations on an order's line items being done exclusively through this service.
This commit is contained in:
@@ -49,7 +49,7 @@ module Admin
|
||||
load_line_item
|
||||
authorize! :update, order
|
||||
|
||||
@line_item.destroy
|
||||
order.contents.remove(@line_item.variant, @line_item.quantity)
|
||||
render body: nil, status: :no_content # No Content, does not trigger ng resource auto-update
|
||||
end
|
||||
|
||||
|
||||
@@ -378,9 +378,6 @@ 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_order!).at_least(:once).and_call_original
|
||||
expect(order).to receive(:create_tax_charge!).at_least(:once).and_call_original
|
||||
|
||||
spree_delete :destroy, params
|
||||
order.reload
|
||||
|
||||
|
||||
Reference in New Issue
Block a user