Skip to content

Instantly share code, notes, and snippets.

@cored
Created October 29, 2018 12:25
Show Gist options
  • Save cored/ddc93a9aa5d5c3a733112a22a1e5021b to your computer and use it in GitHub Desktop.
Save cored/ddc93a9aa5d5c3a733112a22a1e5021b to your computer and use it in GitHub Desktop.
context "when there are shipments that have bundleable products" do
let(:shipments_in) { [shipment1, shipment2] }
let(:shipment1) { build(:shipment, products: [product_a]) }
let(:shipment2) { build(:shipment, products: [product_b]) }
it "returns the bundling product instead of the bundleable ones" do
expect(shipments_out.first.products).to match_array(product_c)
end
it "does not return the unused shipment" do
expect(shipments_out.count).to eq 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment