Commit 8bf7a2ef authored by Rémy Coutable's avatar Rémy Coutable

Fix a flaky spec by ensuring the array order is stable

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b131b903
......@@ -46,7 +46,7 @@ RSpec.describe Gitlab::Audit::Auditor do
it 'records audit events in correct order', :aggregate_failures do
expect { audit! }.to change(AuditEvent, :count).by(2)
event_messages = AuditEvent.all.map { |event| event.details[:custom_message] }
event_messages = AuditEvent.order(:id).map { |event| event.details[:custom_message] }
expect(event_messages).to eq([add_message, remove_message])
end
......
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