mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix issue with generic primary taxon in product factory changing which taxons are correctly counted as being in open order cycles.
This commit is contained in:
@@ -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) }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user