Commit 28520f96 authored by Tan Le's avatar Tan Le

Use push method on Auditable module

External collaborators to `Gitlab::Audit::EventQueue` should not know
about the internals of the queue. Hence, we should use a public method,
instead of interacting with the array using `<<`.
parent a48b0f16
......@@ -4,6 +4,6 @@ module Auditable
def push_audit_event(event)
return unless ::Gitlab::Audit::EventQueue.active?
::Gitlab::Audit::EventQueue.current << event
::Gitlab::Audit::EventQueue.push(event)
end
end
......@@ -13,8 +13,8 @@ RSpec.describe Gitlab::Audit::Auditor do
let(:remove_message) { 'Removed an interesting field from project Gotham' }
let(:operation) do
proc do
::Gitlab::Audit::EventQueue.current << add_message
::Gitlab::Audit::EventQueue.current << remove_message
::Gitlab::Audit::EventQueue.push(add_message)
::Gitlab::Audit::EventQueue.push(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