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
This commit is contained in:
filipefurtad0
2024-09-05 16:50:33 -06:00
parent 632184b0a8
commit b7aaab204c

View File

@@ -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:)
}