summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-10 18:10:02 +0700
committerShinya Maeda <shinya@gitlab.com>2019-06-10 20:16:44 +0700
commit30123910e046696ea713475ca3106bc8bd470124 (patch)
treeb4ea5495b869033e22109f11e1dccecb20984079 /spec
parenta0af34582cf0f3c5d901dfe9c78d9ef05c900d7f (diff)
downloadgitlab-ce-30123910e046696ea713475ca3106bc8bd470124.tar.gz
Cancel Auto Merge when target branch is changedcancel-auto-merge-when-branch-is-changed
When target branch is updated, Auto Merge should be canceled.
Diffstat (limited to 'spec')
-rw-r--r--spec/services/merge_requests/update_service_spec.rb12
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