summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-02-27 17:02:25 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-28 08:32:40 +0100
commit2b8005ae41e7bd29010d54fe8a2c03c7e58b5c66 (patch)
tree5c5c577d88e2657592b2328299641040cd67e931
parent7d60876bc9c95323be185033f7f86b548fdf4728 (diff)
downloadgitlab-ce-2b8005ae41e7bd29010d54fe8a2c03c7e58b5c66.tar.gz
New runner API returns 204api-empty-return
-rw-r--r--lib/api/runner.rb2
-rw-r--r--spec/requests/api/runner_spec.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index 804b27d40a7..47858f1866b 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -38,7 +38,7 @@ module 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)
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 73e82647ca0..e83202e4196 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -123,6 +123,7 @@ describe API::Runner do
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 @@ describe API::Runner do
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 @@ describe API::Runner do
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