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

New runner API returns 204

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