diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-06-10 14:10:02 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-06-10 16:16:44 +0300 |
commit | 30123910e046696ea713475ca3106bc8bd470124 (patch) | |
tree | b4ea5495b869033e22109f11e1dccecb20984079 /spec/services/merge_requests/update_service_spec.rb | |
parent | a0af34582cf0f3c5d901dfe9c78d9ef05c900d7f (diff) |
Cancel Auto Merge when target branch is changed
When target branch is updated, Auto Merge should be canceled.
Diffstat (limited to 'spec/services/merge_requests/update_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index fbfcd95e204..f566d235787 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -406,6 +406,18 @@ describe MergeRequests::UpdateService, :mailer do expect(pending_todo.reload).to be_done end end + + context 'when auto merge is enabled and target branch changed' do + before do + AutoMergeService.new(project, user).execute(merge_request, AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS) + + update_merge_request({ target_branch: 'target' }) + end + + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done + end + end end context 'when the merge request is relabeled' do |