DEV: Fix time dependent flaky test (#528)

If event1 and event2 are fabricated in different second increments, this will flake. This PR provides explicit timestamps to the fabricated events.
This commit is contained in:
Ted Johansson 2024-01-18 15:27:58 +08:00 committed by GitHub
parent b622e0f200
commit 82689c51bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -184,8 +184,8 @@ describe DiscoursePostEvent::EventFinder do
end
describe "with a before parameter provided" do
let!(:event1) { Fabricate(:event) }
let!(:event2) { Fabricate(:event) }
let!(:event1) { Fabricate(:event, original_starts_at: 2.minutes.from_now) }
let!(:event2) { Fabricate(:event, original_starts_at: 1.minute.from_now) }
let!(:event3) { Fabricate(:event, original_starts_at: 2.hours.ago) }
it "returns the events started before the provided value" do