Commit b77d811c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Port EE specific changes to CE

parent a96507bf
...@@ -8,20 +8,24 @@ describe DeleteBranchService do ...@@ -8,20 +8,24 @@ describe DeleteBranchService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:service) { described_class.new(project, 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 describe '#execute' do
context 'when user has access to push to repository' do context 'when user has access to push to repository' do
before do before do
project.add_developer(user) project.add_developer(user)
end end
it 'removes the branch' do it_behaves_like 'a deleted branch', 'feature'
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
end end
context 'when user does not have access to push to repository' do context 'when user does not have access to push to repository' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment