Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix filters_aggregator_spec to use proper variants with option values

Damian Legawiec146ac3c3f2bd
diff --git a/api/spec/services/spree/api/v3/filters_aggregator_spec.rb b/api/spec/services/spree/api/v3/filters_aggregator_spec.rb
index 363e69f527..b153626437 100644
--- a/api/spec/services/spree/api/v3/filters_aggregator_spec.rb
+++ b/api/spec/services/spree/api/v3/filters_aggregator_spec.rb
@@ -14,14 +14,14 @@ RSpec.describe Spree::Api::V3::FiltersAggregator do
let!(:product1) do
create(:product, stores: [store], status: 'active', taxons: [child_taxon]).tap do |p|
p.option_types << option_type
- p.master.option_values << option_value_s
+ create(:variant, product: p, option_values: [option_value_s])
end
end
let!(:product2) do
create(:product, stores: [store], status: 'active', taxons: [child_taxon]).tap do |p|
p.option_types << option_type
- p.master.option_values << option_value_m
+ create(:variant, product: p, option_values: [option_value_m])
end
end