From 1765ba0422a47df2ea88fac4fb3e2585a4199f4d Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 20 May 2016 11:44:16 +1000 Subject: [PATCH] Fix spec dependent on product on_demand --- spec/models/spree/product_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index 10e67e5900..2e188244a9 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -585,10 +585,10 @@ module Spree describe "finding products in stock for a particular distribution" do it "returns on-demand products" do p = create(:simple_product, on_demand: true) - p.master.update_attribute(:count_on_hand, 0) + p.variants.first.update_attributes!(count_on_hand: 0, on_demand: true) d = create(:distributor_enterprise) oc = create(:simple_order_cycle, distributors: [d]) - oc.exchanges.outgoing.first.variants << p.master + oc.exchanges.outgoing.first.variants << p.variants.first p.should have_stock_for_distribution(oc, d) end