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 spec for the product sorting

Damian Kaczmarczyk94766dd59695
diff --git a/frontend/spec/features/products_sorting_spec.rb b/frontend/spec/features/products_sorting_spec.rb
index b06816da1d..eb226a7c71 100644
--- a/frontend/spec/features/products_sorting_spec.rb
+++ b/frontend/spec/features/products_sorting_spec.rb
@@ -20,8 +20,9 @@ describe 'Products sorting', type: :feature, js: true, retry: 3 do
before do
visit spree.products_path
- create_list(:product, 10, stores: [store]).each do |p|
- p.price = rand(1..100)
+ random_prices = (1..100).to_a.shuffle.sample(10)
+ create_list(:product, 10, stores: [store]).each_with_index do |p, i|
+ p.price = random_prices[i]
p.save
end
store.products.reload