From b7aaab204cd3c5685d5c16d653bfd884565eea7c Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Thu, 5 Sep 2024 16:50:33 -0600 Subject: [PATCH] Adds timer restriction with Timecop The datet-time-picker test case was failing for me locally, but passing on GH-Actions. Controlling the time should prevent this type of flakyness --- spec/system/admin/reports/orders_and_distributors_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/system/admin/reports/orders_and_distributors_spec.rb b/spec/system/admin/reports/orders_and_distributors_spec.rb index 7da1057c4e..3ee051923b 100644 --- a/spec/system/admin/reports/orders_and_distributors_spec.rb +++ b/spec/system/admin/reports/orders_and_distributors_spec.rb @@ -13,6 +13,10 @@ RSpec.describe "Orders And Distributors" do let!(:distributor2) { create(:distributor_enterprise, name: "By Moto") } let!(:completed_at) { Time.zone.now.to_fs(:db) } + around do |example| + Timecop.travel(completed_at) { example.run } + end + let!(:order) { create(:order_ready_to_ship, distributor_id: distributor.id, completed_at:) }