From 99b31d05cb801d23216f9514b6acfff790e95b30 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 2 Aug 2024 14:14:20 +1000 Subject: [PATCH] Fix flaky spec with fixed order of products --- .../complex_editing_multiple_product_pages_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb index fca4b55f11..ed0fc31b20 100644 --- a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb +++ b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb @@ -13,7 +13,13 @@ RSpec.describe ' describe "editing an order cycle with multiple pages of products" do let(:order_cycle) { create(:order_cycle) } let(:supplier_enterprise) { order_cycle.exchanges.incoming.first.sender } - let!(:new_product) { create(:product, supplier_id: supplier_enterprise.id) } + let!(:new_product) { + create( + :product, + supplier_id: supplier_enterprise.id, + name: "Z Last Product", # ordered by name + ) + } before do stub_const("#{Api::V0::ExchangeProductsController}::DEFAULT_PER_PAGE", 1) @@ -26,7 +32,7 @@ RSpec.describe ' expect(page).to have_selector ".exchange-product-details" expect(page).to have_content "1 of 2 Variants Loaded" - expect(page).not_to have_content new_product.name + expect(page).not_to have_content "Z Last Product" end it "load all products" do