Commit 338c7b31 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'process-when-auto-merge-is-enabled' into 'master'

Notify events when auto merge is enabled or merge param is updated

See merge request gitlab-org/gitlab-ce!29415
parents 641d3323 8f243acf
......@@ -14,6 +14,9 @@ module AutoMerge
yield if block_given?
# Notify the event that auto merge is enabled or merge param is updated
AutoMergeProcessWorker.perform_async(merge_request.id)
strategy.to_sym
end
......
......@@ -12,6 +12,10 @@ describe AutoMerge::BaseService do
describe '#execute' do
subject { service.execute(merge_request) }
before do
allow(AutoMergeProcessWorker).to receive(:perform_async) {}
end
it 'sets properies to the merge request' do
subject
......@@ -65,6 +69,12 @@ describe AutoMerge::BaseService do
it 'returns activated strategy name' do
is_expected.to eq(AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS.to_sym)
end
it 'calls AutoMergeProcessWorker' do
expect(AutoMergeProcessWorker).to receive(:perform_async).with(merge_request.id).once
subject
end
end
context 'when failed to save' do
......
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