From 6ee715419a1ed3912074e20751b3b3729eb192ee Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 10 Mar 2026 14:25:27 +1100 Subject: [PATCH] ORder by ID to ensure deterministic results --- spec/requests/admin/products_v3_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/requests/admin/products_v3_spec.rb b/spec/requests/admin/products_v3_spec.rb index e5fdfac7b7..54a854bd1f 100644 --- a/spec/requests/admin/products_v3_spec.rb +++ b/spec/requests/admin/products_v3_spec.rb @@ -98,7 +98,7 @@ RSpec.describe "Admin::ProductsV3" do expect(response.body).to match "Original variant" # cloned variant name }.to change { variant.product.variants.count }.by(1) - new_variant = variant.product.variants.last + new_variant = variant.product.variants.order(:id).last # The new variant is a target of the original. It is a "sourced" variant. expect(variant.target_variants.first).to eq new_variant # The new variant's source is the original @@ -120,7 +120,7 @@ RSpec.describe "Admin::ProductsV3" do }.to change { variant.product.variants.count }.by(1) # The new variant is owned by my enterprise that has permission, not the other one - new_variant = variant.product.variants.last + new_variant = variant.product.variants.order(:id).last expect(new_variant.owner).to eq enterprise end end