diff --git a/spec/controllers/spree/orders_controller_spec.rb b/spec/controllers/spree/orders_controller_spec.rb index 75f26c67b6..d77e493128 100644 --- a/spec/controllers/spree/orders_controller_spec.rb +++ b/spec/controllers/spree/orders_controller_spec.rb @@ -224,7 +224,16 @@ describe Spree::OrdersController, type: :controller do } } } - expect(order.adjustments.map(&:state)).to eq(['closed', 'closed', 'closed']) + # Before issuing the update, the second adjustment, which is associated + # to the shipment, is already open thus restoring its state leaves it + # also open. + # + # The third adjustment is originated from an EnterpriseFee and it gets + # created by #update_distribution_charge! in + # app/models/spree/order_decorator.rb:220, which is in turn triggered + # by the `contents_changed` notification event defined in + # app/models/spree/order_decorator.rb:7 + expect(order.adjustments.map(&:state)).to eq(['closed', 'open', 'closed']) end end