Commit de605ad1 authored by Matija Čupić's avatar Matija Čupić

Add spec for Pipeline DELETE for developers

parent b7e5f73c
...@@ -473,13 +473,30 @@ describe API::Pipelines do ...@@ -473,13 +473,30 @@ describe API::Pipelines do
end end
context 'unauthorized user' do context 'unauthorized user' do
context 'when user is not member' do
it 'should return a 404' do it 'should return a 404' do
get api("/projects/#{project.id}/pipelines/#{pipeline.id}", non_member) delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", non_member)
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(json_response['message']).to eq '404 Project Not Found' expect(json_response['message']).to eq '404 Project Not Found'
end end
end end
context 'when user is developer' do
let(:developer) { create(:user) }
before do
project.add_developer(developer)
end
it 'should return a 403' do
delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", developer)
expect(response).to have_gitlab_http_status(403)
expect(json_response['message']).to eq '403 Forbidden'
end
end
end
end end
describe 'POST /projects/:id/pipelines/:pipeline_id/retry' do describe 'POST /projects/:id/pipelines/:pipeline_id/retry' 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