spree/spree — pull request #2387 by huoxito (2013-01-05 08:20:28+00:00)
Title: Removes useless call to order#update!

The only reason I could see for those to be there is to make a test
pass. But the problem was on the test itself due to the way stubs work.
Also add some doc blocks to CreateAdjustment class.

By the time update_totals is called the order item_total would be 0 again because the order in that test has no line items. I hope that helps understanding why that test failed when the order#update! calls were removed. This was really confusing to figure out. After 20 min running the promo tests I got a green build so we should be still good after this.

Every time an adjustment is saved the order#update! is called so there's no need to call it before and after a promo adjustment is created.

I also added a missing association to make it clear that this class is associated with adjustments through an originator.

If I missed any reason for having two calls for order#update! around create please let me know.