spree/spree — Issue #925: Clear Shipment when go back to 'address' or 'delivery' from other states in Order checkout
Author: joneslee85
Created: 2011-12-30 15:38:08+00:00
State: open

I found an interesting bug with the way Spree store order `shipping_method_id` and `shipment_state` in state_machine.

- Given your address zone is North America
- You choose UPS Standard $5.00 at Delivery step

- Given you are at Payment step
- You go back to Address step and change your country to European zone

- Given new list of shipment options in Delivery step (let's make it up, something like FedEx Standard $53.00)
- You don't check / choose any of these options and Continue to Payment step

Results:
- No errors complaining about you have not yet chosen a shipping method
- Shipping method is still set to UPS Standard $5.00

Expectation:
- Errors on No method is chosen

IMHO, we should have a callback for any state but 'address' and 'delivery' to clear the shipment or shipment adjustment of the order.