spree/spree — pull request #3497 by huoxito (2013-08-03 22:15:59+00:00)
Title: Introduce better approach for regenerating shipments

Instead of recreating shipments every time customers change order items
it only destroy shipments, if any exists, and put order state back into
address so users are forced to transition the order again from address
to delivery and so still recreate shipments properly

Another minor change on CheckoutController was necessary. We need to run
`setup_for_current_state` only after all other check are done. e.g.
authentication, valid order state. This is so that customer don't get
their items removed by the Differentiator. Current specs should cover
all possible scnearios I could think of.

I believe this is a better approach than what my previous suggestion in #3339 and it should help experience for customers going back from delivery step and changing order items, see #3405. It basically force users to go through delivery step again when shipments need to be recreated as suggested by @BDQ. By that we'd actually create shipments in one single place.

This is a rather critical change imo so I'd appreciate feedback from everyone. CI looks good and it should apply cleanly in 2-0-stable.