Commit 2bf26b81 authored by Tan Le's avatar Tan Le

Fix flaky test due to ordering

Explicitly set `created_at` to make ordering deterministic.
parent 3e6a4c42
......@@ -3,7 +3,12 @@
require 'spec_helper'
RSpec.describe Gitlab::Audit::Events::Preloader do
let_it_be(:audit_events) { create_list(:audit_event, 2) }
let_it_be(:audit_events) do
[
create(:audit_event, created_at: 2.days.ago),
create(:audit_event, created_at: 1.day.ago)
]
end
let(:audit_events_relation) { AuditEvent.where(id: audit_events.map(&:id)) }
describe '.preload!' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment