summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-05-22 18:45:27 +0700
committerShinya Maeda <shinya@gitlab.com>2019-06-03 13:15:29 +0700
commitd4b46936633a3b2a0248b4572b4a1dc7b2ba8531 (patch)
treebf5c1cf5a8ebf1568ca62576d63ff793ce29764f /spec/features
parent96744d0befd7e298c08e6d20a4f504086a717c35 (diff)
downloadgitlab-ce-d4b46936633a3b2a0248b4572b4a1dc7b2ba8531.tar.gz
Abstract auto merge processes
We have one auto merge strategy today - Merge When Pipeline Succeeds. In order to add more strategies for Merge Train feature, we abstract the architecture to be more extensible. Removed arguments Fix spec
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb15
-rw-r--r--spec/features/merge_request/user_sees_merge_widget_spec.rb3
2 files changed, 10 insertions, 8 deletions
diff --git a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
index d4ad11b3585..e7b92dc5535 100644
--- a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
+++ b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
@@ -74,11 +74,12 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
source_project: project,
title: 'Bug NS-04',
author: user,
- merge_user: user,
- merge_params: { force_remove_source_branch: '1' })
+ merge_user: user)
end
before do
+ merge_request.merge_params['force_remove_source_branch'] = '0'
+ merge_request.save!
click_link "Cancel automatic merge"
end
@@ -102,11 +103,11 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
context 'when merge when pipeline succeeds is enabled' do
let(:merge_request) do
- create(:merge_request_with_diffs, :simple, source_project: project,
- author: user,
- merge_user: user,
- title: 'MepMep',
- merge_when_pipeline_succeeds: true)
+ create(:merge_request_with_diffs, :simple, :merge_when_pipeline_succeeds,
+ source_project: project,
+ author: user,
+ merge_user: user,
+ title: 'MepMep')
end
let!(:build) do
create(:ci_build, pipeline: pipeline)
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb
index 93ddde623fe..1477307ed7b 100644
--- a/spec/features/merge_request/user_sees_merge_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb
@@ -314,7 +314,8 @@ describe 'Merge request > User sees merge widget', :js do
context 'view merge request with MWPS enabled but automatically merge fails' do
before do
merge_request.update(
- merge_when_pipeline_succeeds: true,
+ auto_merge_enabled: true,
+ auto_merge_strategy: AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS,
merge_user: merge_request.author,
merge_error: 'Something went wrong'
)