From e901886915d8d2fa34d2db89bfc787e4c01f32e3 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 21 May 2024 15:36:44 +1000 Subject: [PATCH] Fix report system spec --- spec/system/admin/reports_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 80839873d2..8902d93461 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -379,16 +379,16 @@ RSpec.describe ' let(:supplier) { create(:supplier_enterprise, name: 'Supplier Name') } let(:taxon) { create(:taxon, name: 'Taxon Name') } let(:product1) { - create(:simple_product, name: "Product Name", price: 100, supplier:, - primary_taxon_id: taxon.id) + create(:simple_product, name: "Product Name", price: 100, primary_taxon_id: taxon.id, + supplier_id: supplier.id) } let(:product2) { create(:simple_product, name: "Product 2", price: 99.0, variant_unit: 'weight', - variant_unit_scale: 1, unit_value: '100', supplier:, - primary_taxon_id: taxon.id, sku: "product_sku") + variant_unit_scale: 1, unit_value: '100', + primary_taxon_id: taxon.id, sku: "product_sku", supplier_id: supplier.id) } let(:variant1) { product1.variants.first } - let(:variant2) { create(:variant, product: product1, price: 80.0, primary_taxon: taxon) } + let(:variant2) { create(:variant, product: product1, price: 80.0, primary_taxon: taxon, supplier:) } let(:variant3) { product2.variants.first } before do @@ -415,18 +415,18 @@ RSpec.describe ' expect(page).to have_table_row ["Supplier", "Producer Suburb", "Product", "Product Properties", "Taxons", "Variant Value", "Price", "Group Buy Unit Quantity", "Amount", "SKU", - "On Demand?", "On Hand"] - expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, + "On Demand?", "On hand"] + expect(page).to have_table_row [supplier.name, supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), taxon.name, "1g", "100.0", "none", "", "sku1", "No", "10"] - expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, + expect(page).to have_table_row [supplier.name, supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), taxon.name, "1g", "80.0", "none", "", "sku2", "No", "20"] - expect(page).to have_table_row [product2.supplier.name, product1.supplier.address.city, + expect(page).to have_table_row [supplier.name, supplier.address.city, "Product 2", product1.properties.map(&:presentation).join(", "), taxon.name, "100g", "99.0",