diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 21:06:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 21:06:17 +0000 |
commit | 11faf8ae72dcdbaff31f97410a3a9319324438fd (patch) | |
tree | 2dc680f52ef8b2355c9097dfd1bbeb5ba899df3c /spec/services/merge_requests | |
parent | 7f0a4a64d0bc59b184ae3ee578adb6ebd3c48bf7 (diff) | |
download | gitlab-ce-11faf8ae72dcdbaff31f97410a3a9319324438fd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/merge_requests')
-rw-r--r-- | spec/services/merge_requests/build_service_spec.rb | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/spec/services/merge_requests/build_service_spec.rb b/spec/services/merge_requests/build_service_spec.rb index 61cb60e1536..46e86d5b4cb 100644 --- a/spec/services/merge_requests/build_service_spec.rb +++ b/spec/services/merge_requests/build_service_spec.rb @@ -80,7 +80,7 @@ describe MergeRequests::BuildService do end it 'does not assign force_remove_source_branch' do - expect(merge_request.force_remove_source_branch?).to be_falsey + expect(merge_request.force_remove_source_branch?).to be_truthy end context 'with force_remove_source_branch parameter' do @@ -90,6 +90,36 @@ describe MergeRequests::BuildService do it 'assigns force_remove_source_branch' do expect(merge_request.force_remove_source_branch?).to be_truthy end + + context 'with project setting remove_source_branch_after_merge false' do + before do + project.remove_source_branch_after_merge = false + end + + it 'assigns force_remove_source_branch' do + expect(merge_request.force_remove_source_branch?).to be_truthy + end + end + end + + context 'with project setting remove_source_branch_after_merge true' do + before do + project.remove_source_branch_after_merge = true + end + + it 'assigns force_remove_source_branch' do + expect(merge_request.force_remove_source_branch?).to be_truthy + end + + context 'with force_remove_source_branch parameter false' do + before do + params[:force_remove_source_branch] = '0' + end + + it 'does not assign force_remove_source_branch' do + expect(merge_request.force_remove_source_branch?).to be(false) + end + end end context 'missing source branch' do |