Port EE specific changes to CE

This commit is contained in:
Lin Jen-Shin 2019-04-19 23:51:49 +08:00
parent a96507bf00
commit b77d811c82
1 changed files with 12 additions and 8 deletions

View File

@ -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