it'returns an error if the user is not allowed to delete protected branches'do
context'if the user is not allowed to delete protected branches'do
it'returns an error'do
expect(subject.status).tobe(false)
expect(subject.message).toeq('You are not allowed to delete protected branches from this project.')
expect(subject.message).toeq('You are not allowed to delete protected branches from this project. Only a project master or owner can delete a protected branch.')
end
end
context'if the user is allowed to delete protected branches'do
beforedo
project.add_master(user)
end
context'through the web interface'do
let(:protocol){'web'}
it'allows branch deletion'do
expect(subject.status).tobe(true)
end
end
context'over SSH or HTTP'do
it'returns an error'do
expect(subject.status).tobe(false)
expect(subject.message).toeq('You can only delete protected branches using the web interface.')