summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-04-19 23:51:49 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-04-22 17:16:32 +0800
commitb77d811c824ceb09669bf57205f490c565beb795 (patch)
tree0993635ca26c286f3eccaf05cd620d55517931be
parenta96507bf002f39c7119d91f45c872065a05ad389 (diff)
downloadgitlab-ce-60730-service-response.tar.gz
Port EE specific changes to CE60730-service-response
-rw-r--r--spec/services/delete_branch_service_spec.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/services/delete_branch_service_spec.rb b/spec/services/delete_branch_service_spec.rb
index 6bcb67c972c..b8064c2cbc1 100644
--- a/spec/services/delete_branch_service_spec.rb
+++ b/spec/services/delete_branch_service_spec.rb
@@ -8,20 +8,24 @@ describe DeleteBranchService do
let(:user) { create(:user) }
let(:service) { described_class.new(project, user) }
+ shared_examples 'a deleted branch' do |branch_name|
+ it 'removes the branch' do
+ expect(branch_exists?(branch_name)).to be true
+
+ result = service.execute(branch_name)
+
+ expect(result.status).to eq :success
+ expect(branch_exists?(branch_name)).to be false
+ end
+ end
+
describe '#execute' do
context 'when user has access to push to repository' do
before do
project.add_developer(user)
end
- it 'removes the branch' do
- expect(branch_exists?('feature')).to be true
-
- result = service.execute('feature')
-
- expect(result.status).to eq :success
- expect(branch_exists?('feature')).to be false
- end
+ it_behaves_like 'a deleted branch', 'feature'
end
context 'when user does not have access to push to repository' do