Commit 2b8005ae authored by Robert Schilling's avatar Robert Schilling

New runner API returns 204

parent 7d60876b
......@@ -38,7 +38,7 @@ class Runner < Grape::API
end
desc 'Deletes a registered Runner' do
http_codes [[200, 'Runner was deleted'], [403, 'Forbidden']]
http_codes [[204, 'Runner was deleted'], [403, 'Forbidden']]
end
params do
requires :token, type: String, desc: %q(Runner's authentication token)
......
......@@ -123,6 +123,7 @@
context 'when no token is provided' do
it 'returns 400 error' do
delete api('/runners')
expect(response).to have_http_status 400
end
end
......@@ -130,6 +131,7 @@
context 'when invalid token is provided' do
it 'returns 403 error' do
delete api('/runners'), token: 'invalid'
expect(response).to have_http_status 403
end
end
......@@ -139,7 +141,8 @@
it 'deletes Runner' do
delete api('/runners'), token: runner.token
expect(response).to have_http_status 200
expect(response).to have_http_status 204
expect(Ci::Runner.count).to eq(0)
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