Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2017-07-04 12:51:00 +0300
committerToon Claes <toon@iotcl.com>2017-07-04 13:14:40 +0300
commite0f106ae97334d622c6eb7580e72e17181fddd6e (patch)
tree2d1c439e97685bc167c832cfd3a93fdf2b505281 /spec
parentf8973d76bd399a7c3638133bb75b2158faad7bf4 (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')
-rw-r--r--spec/services/delete_merged_branches_service_spec.rb8
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) }