mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #7507 from Matt-Yorkley/shipment-state-update
Shipment callback state update
This commit is contained in:
@@ -331,6 +331,15 @@ module Spree
|
||||
fee_adjustment.finalize!
|
||||
send_shipped_email
|
||||
touch :shipped_at
|
||||
update_order_shipment_state
|
||||
end
|
||||
|
||||
def update_order_shipment_state
|
||||
new_state = order.updater.update_shipment_state
|
||||
order.update_columns(
|
||||
shipment_state: new_state,
|
||||
updated_at: Time.zone.now,
|
||||
)
|
||||
end
|
||||
|
||||
def send_shipped_email
|
||||
|
||||
@@ -101,6 +101,7 @@ module OrderManagement
|
||||
end
|
||||
|
||||
order.state_changed('shipment')
|
||||
order.shipment_state
|
||||
end
|
||||
|
||||
# Updates the +payment_state+ attribute according to the following logic:
|
||||
|
||||
@@ -93,6 +93,7 @@ feature '
|
||||
|
||||
expect(page).to have_css "i.success"
|
||||
expect(order.reload.shipments.any?(&:shipped?)).to be true
|
||||
expect(order.shipment_state).to eq("shipped")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user