diff --git a/core/spec/models/spree/stock/coordinator_spec.rb b/core/spec/models/spree/stock/coordinator_spec.rb index f3b70a841ef..3ff3db3f43a 100644 --- a/core/spec/models/spree/stock/coordinator_spec.rb +++ b/core/spec/models/spree/stock/coordinator_spec.rb @@ -22,6 +22,15 @@ module Stock subject.shipments end + it 'connects the shipment before calling the estimator' do + expect_any_instance_of(Spree::Config.stock.estimator_class).to( + receive(:shipping_rates).and_call_original { |package| + expect(package.shipment).to be_present + } + ) + subject.shipments + end + it 'builds shipments' do expect(subject.shipments.size).to eq(1) end