diff options
author | Toon Claes <toon@iotcl.com> | 2017-07-04 12:51:00 +0300 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-07-04 13:14:40 +0300 |
commit | e0f106ae97334d622c6eb7580e72e17181fddd6e (patch) | |
tree | 2d1c439e97685bc167c832cfd3a93fdf2b505281 /spec/services/delete_merged_branches_service_spec.rb | |
parent | f8973d76bd399a7c3638133bb75b2158faad7bf4 (diff) |
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/services/delete_merged_branches_service_spec.rb')
-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) } |