blob: 4fc15cacab4bc49ffae6add99314eefbe9c442f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# frozen_string_literal: true
RSpec.shared_examples 'subscribes to event' do
include AfterNextHelpers
it 'consumes the published event', :sidekiq_inline do
expect_next(described_class)
.to receive(:handle_event)
.with(instance_of(event.class))
.and_call_original
::Gitlab::EventStore.publish(event)
end
end
def consume_event(subscriber:, event:)
subscriber.new.perform(event.class.name, event.data)
end
|