Stabilise flaky spec with deterministic row order

This commit is contained in:
Maikel Linke
2023-08-07 16:36:20 +10:00
parent 146b09dc57
commit a34a351cee

View File

@@ -95,6 +95,10 @@ describe Reporting::Reports::OrdersAndFulfillment::OrderCycleSupplierTotals do
# This second line item will have a default a bigint value.
order.line_items << create(:line_item)
# Create deterministic / aphabetical order of items:
order.line_items[0].variant.product.update!(name: "Apple")
order.line_items[1].variant.product.update!(name: "Banana")
# Generating the report used to raise:
# > TypeError: no implicit conversion of BigDecimal into String
expect(table_headers[4]).to eq "Total Units"