Skip to content

Commit

Permalink
Fix flaky spec with fixed order of products
Browse files Browse the repository at this point in the history
  • Loading branch information
mkllnk committed Aug 2, 2024
1 parent 77e672d commit e864f60
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
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)
Expand All @@ -26,7 +32,7 @@
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
Expand Down

0 comments on commit e864f60

Please sign in to comment.