Commit 872ccc09 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '334774-fix-a-flaky-test' into 'master'

Fix a flaky spec by ensuring the array order is stable

See merge request gitlab-org/gitlab!65134
parents a17c395e 8bf7a2ef
...@@ -46,7 +46,7 @@ RSpec.describe Gitlab::Audit::Auditor do ...@@ -46,7 +46,7 @@ RSpec.describe Gitlab::Audit::Auditor do
it 'records audit events in correct order', :aggregate_failures do it 'records audit events in correct order', :aggregate_failures do
expect { audit! }.to change(AuditEvent, :count).by(2) 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]) expect(event_messages).to eq([add_message, remove_message])
end 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