diff options
author | Toon Claes <toon@iotcl.com> | 2017-07-04 11:51:00 +0200 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-07-04 12:14:40 +0200 |
commit | e0f106ae97334d622c6eb7580e72e17181fddd6e (patch) | |
tree | 2d1c439e97685bc167c832cfd3a93fdf2b505281 /spec | |
parent | f8973d76bd399a7c3638133bb75b2158faad7bf4 (diff) | |
download | gitlab-ce-e0f106ae97334d622c6eb7580e72e17181fddd6e.tar.gz |
DeleteMergedBranchesService should not delete protected branches
When deleting all the branches that are merged, the protected branches
should not be deleted.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/delete_merged_branches_service_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/delete_merged_branches_service_spec.rb b/spec/services/delete_merged_branches_service_spec.rb index cae74df9c90..fe21ca0b3cb 100644 --- a/spec/services/delete_merged_branches_service_spec.rb +++ b/spec/services/delete_merged_branches_service_spec.rb @@ -24,6 +24,14 @@ describe DeleteMergedBranchesService, services: true do expect(project.repository.branch_names).to include('master') end + it 'keeps protected branches' do + create(:protected_branch, project: project, name: 'improve/awesome') + + service.execute + + expect(project.repository.branch_names).to include('improve/awesome') + end + context 'user without rights' do let(:user) { create(:user) } |