Merge pull request #7507 from Matt-Yorkley/shipment-state-update

Shipment callback state update
This commit is contained in:
Pau Pérez Fabregat
2021-04-29 12:01:55 +02:00
committed by GitHub
3 changed files with 11 additions and 0 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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