2021-05-14 09:10:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe WebHookWorker do
|
|
|
|
include AfterNextHelpers
|
|
|
|
|
|
|
|
let_it_be(:project_hook) { create(:project_hook) }
|
|
|
|
let_it_be(:data) { { foo: 'bar' } }
|
|
|
|
let_it_be(:hook_name) { 'push_hooks' }
|
|
|
|
|
|
|
|
describe '#perform' do
|
|
|
|
it 'delegates to WebHookService' do
|
2021-06-09 09:10:18 +00:00
|
|
|
expect_next(WebHookService, project_hook, data.with_indifferent_access, hook_name, anything).to receive(:execute)
|
2021-05-14 09:10:24 +00:00
|
|
|
|
|
|
|
subject.perform(project_hook.id, data, hook_name)
|
|
|
|
end
|
2021-05-20 15:10:13 +00:00
|
|
|
|
|
|
|
it_behaves_like 'worker with data consistency',
|
|
|
|
described_class,
|
|
|
|
feature_flag: :load_balancing_for_web_hook_worker,
|
|
|
|
data_consistency: :delayed
|
2021-05-14 09:10:24 +00:00
|
|
|
end
|
|
|
|
end
|