diff --git a/spec/features/consumer/producers_spec.rb b/spec/features/consumer/producers_spec.rb index f8d7e3bb57..d58ebe1397 100644 --- a/spec/features/consumer/producers_spec.rb +++ b/spec/features/consumer/producers_spec.rb @@ -16,8 +16,8 @@ feature ' let(:taxon_fruit) { create(:taxon, name: 'Fruit') } let(:taxon_veg) { create(:taxon, name: 'Vegetables') } - let!(:product1) { create(:simple_product, supplier: producer1, taxons: [taxon_fruit]) } - let!(:product2) { create(:simple_product, supplier: producer2, taxons: [taxon_veg]) } + let!(:product1) { create(:simple_product, supplier: producer1, primary_taxon: taxon_fruit, taxons: [taxon_fruit]) } + let!(:product2) { create(:simple_product, supplier: producer2, primary_taxon: taxon_veg, taxons: [taxon_veg]) } let(:shop) { create(:distributor_enterprise) } let!(:er) { create(:enterprise_relationship, parent: shop, child: producer1) } diff --git a/spec/features/consumer/shops_spec.rb b/spec/features/consumer/shops_spec.rb index 87db26883c..236e556b79 100644 --- a/spec/features/consumer/shops_spec.rb +++ b/spec/features/consumer/shops_spec.rb @@ -110,13 +110,13 @@ feature 'Shops', js: true do describe "taxon badges" do let!(:closed_oc) { create(:closed_order_cycle, distributors: [shop], variants: [p_closed.variants.first]) } - let!(:p_closed) { create(:simple_product, taxons: [taxon_closed]) } + let!(:p_closed) { create(:simple_product, primary_taxon: taxon_closed, taxons: [taxon_closed]) } let(:shop) { create(:distributor_enterprise, with_payment_and_shipping: true) } let(:taxon_closed) { create(:taxon, name: 'Closed') } describe "open shops" do let!(:open_oc) { create(:open_order_cycle, distributors: [shop], variants: [p_open.variants.first]) } - let!(:p_open) { create(:simple_product, taxons: [taxon_open]) } + let!(:p_open) { create(:simple_product, primary_taxon: taxon_open, taxons: [taxon_open]) } let(:taxon_open) { create(:taxon, name: 'Open') } it "shows taxons for open order cycles only" do