diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-06-06 10:25:06 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-06-12 09:20:49 +0300 |
commit | b8c131715296dbd864bb7417ef04fc2ad7e18a53 (patch) | |
tree | c6d9ae7c27b30db1e20c04b5ca925401171ac0d1 /spec/services/auto_merge | |
parent | 9baff6f6b58981ac1565d371b01948a286f7bffd (diff) |
Update merge options for auto merge strategies
Currently, merge options is updated on #execute method,
however, we should have #update interface to make it explicit.
Diffstat (limited to 'spec/services/auto_merge')
-rw-r--r-- | spec/services/auto_merge/base_service_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/services/auto_merge/base_service_spec.rb b/spec/services/auto_merge/base_service_spec.rb index 35d60d6abbb..cd08e0b6f32 100644 --- a/spec/services/auto_merge/base_service_spec.rb +++ b/spec/services/auto_merge/base_service_spec.rb @@ -92,6 +92,30 @@ describe AutoMerge::BaseService do end end + describe '#update' do + subject { service.update(merge_request) } + + let(:merge_request) { create(:merge_request, :merge_when_pipeline_succeeds) } + + context 'when merge params are specified' do + let(:params) do + { + 'commit_message' => "Merge branch 'patch-12' into 'master'", + 'sha' => "200fcc9c260f7219eaf0daba87d818f0922c5b18", + 'should_remove_source_branch' => false, + 'squash' => false, + 'squash_commit_message' => "Update README.md" + } + end + + it 'updates merge params' do + expect { subject }.to change { + merge_request.reload.merge_params.slice(*params.keys) + }.from({}).to(params) + end + end + end + describe '#cancel' do subject { service.cancel(merge_request) } |