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

Add spec for Pipeline DELETE for developers

parent b7e5f73c
...@@ -473,11 +473,28 @@ describe API::Pipelines do ...@@ -473,11 +473,28 @@ describe API::Pipelines do
end end
context 'unauthorized user' do context 'unauthorized user' do
it 'should return a 404' do context 'when user is not member' do
get api("/projects/#{project.id}/pipelines/#{pipeline.id}", non_member) it 'should return a 404' do
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
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
end end
......
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