Skip to content

Commit

Permalink
Add spec for having shipment on package before calling estimator
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-brough committed Mar 4, 2016
1 parent 3c7f792 commit 86e4dd8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/spec/models/spree/stock/coordinator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86e4dd8

Please sign in to comment.