From cb4e7d6fe3732540c880a522b510c53635bb0cac Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 2 Jul 2024 13:29:58 +1000 Subject: [PATCH] Fix spec to assert updating shipments The spec was asserting on all shipments of the order but there were one. In consequence, the spec didn't assert anything. Now I set up a shipment that is asserted on. I'm stil not sure how useful this spec is though. --- spec/models/spree/order_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 1b12fcbc3d..7fa0f365c1 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -229,10 +229,12 @@ RSpec.describe Spree::Order do end it "should sell inventory units" do - order.shipments.each do |shipment| - expect(shipment).to receive(:update!) - expect(shipment).to receive(:finalize!) - end + shipment = Spree::Shipment.new + order.shipments = [shipment] + + expect(shipment).to receive(:update!).with(order) + expect(shipment).to receive(:finalize!) + order.finalize! end