diff --git a/core/spec/models/spree/order_spec.rb b/core/spec/models/spree/order_spec.rb index 744b19b710b..251983882cc 100644 --- a/core/spec/models/spree/order_spec.rb +++ b/core/spec/models/spree/order_spec.rb @@ -379,13 +379,13 @@ def merge!(other_order, user = nil) it "does nothing if any shipments are ready" do shipment = create(:shipment, order: subject, state: "ready") - expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments } + expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) } expect { shipment.reload }.not_to raise_error end it "does nothing if any shipments are shipped" do shipment = create(:shipment, order: subject, state: "shipped") - expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments } + expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) } expect { shipment.reload }.not_to raise_error end end @@ -1102,11 +1102,12 @@ def generate it "raises an error if any shipments are ready" do shipment = create(:shipment, order: subject, state: "ready") + expect { expect { subject.create_proposed_shipments }.to raise_error(Spree::Order::CannotRebuildShipments) - }.not_to change { subject.reload.shipments } + }.not_to change { subject.reload.shipments.pluck(:id) } expect { shipment.reload }.not_to raise_error end @@ -1117,7 +1118,7 @@ def generate expect { subject.create_proposed_shipments }.to raise_error(Spree::Order::CannotRebuildShipments) - }.not_to change { subject.reload.shipments } + }.not_to change { subject.reload.shipments.pluck(:id) } expect { shipment.reload }.not_to raise_error end