From 228f69f13ef19943778411e0ae102d21486df350 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 9 Oct 2023 12:05:24 +1100 Subject: [PATCH] Test customer report filtering without sorting The report doesn't seem to sort. So the specs don't expect that either now. These specs were flaky before, depending on the random order in the database query result. --- spec/lib/reports/customers_report_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/reports/customers_report_spec.rb b/spec/lib/reports/customers_report_spec.rb index 75d03e0615..7e0a4fac0d 100644 --- a/spec/lib/reports/customers_report_spec.rb +++ b/spec/lib/reports/customers_report_spec.rb @@ -266,7 +266,7 @@ module Reporting completed_at_lt: 1.day.after(o2.completed_at) } ) - expect(subject.filter(orders)).to eq([o2, o3]) + expect(subject.filter(orders)).to match_array [o2, o3] end it "when completed_at_lt param is missing" do @@ -276,7 +276,7 @@ module Reporting completed_at_lt: "" } ) - expect(subject.filter(orders)).to eq([o1, o2]) + expect(subject.filter(orders)).to match_array [o1, o2] end end