ORder by ID to ensure deterministic results

This commit is contained in:
David Cook
2026-03-10 14:25:27 +11:00
parent 7da6adfe4f
commit 6ee715419a

View File

@@ -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