diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-08-01 01:01:36 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-08-07 21:23:37 +0300 |
commit | 0640b3d1d89b7a4eda343eb23b0518a835ac9106 (patch) | |
tree | 13970b43017ada593f08b70ca713dc19a1f064cf /spec/workers/merge_worker_spec.rb | |
parent | b12107a0b953b566cd58db30ae880800a4a695a6 (diff) |
Store MergeWorker JID on merge request, and clean up stuck merges
Diffstat (limited to 'spec/workers/merge_worker_spec.rb')
-rw-r--r-- | spec/workers/merge_worker_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/workers/merge_worker_spec.rb b/spec/workers/merge_worker_spec.rb index 303193bab9b..ee51000161a 100644 --- a/spec/workers/merge_worker_spec.rb +++ b/spec/workers/merge_worker_spec.rb @@ -27,4 +27,15 @@ describe MergeWorker do expect(source_project.repository.branch_names).not_to include('markdown') end end + + it 'persists merge_jid' do + merge_request = create(:merge_request, merge_jid: nil) + user = create(:user) + worker = described_class.new + + allow(worker).to receive(:jid) { '999' } + + expect { worker.perform(merge_request.id, user.id, {}) } + .to change { merge_request.reload.merge_jid }.from(nil).to('999') + end end |