summaryrefslogtreecommitdiff
path: root/spec/requests/api/runners_spec.rb
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2018-06-11 13:36:36 +0200
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2018-09-15 21:39:18 +0200
commit65caacc600bc0a507a313e8be45021512260906e (patch)
treec30a154a9d3a59f45dde29574b0fbcd61108c3cb /spec/requests/api/runners_spec.rb
parenta30e266e438bc511b42af1ae7c05081ce115f29e (diff)
downloadgitlab-ce-65caacc600bc0a507a313e8be45021512260906e.tar.gz
fix and add missing api specs
Diffstat (limited to 'spec/requests/api/runners_spec.rb')
-rw-r--r--spec/requests/api/runners_spec.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb
index 3ebdb54f71f..c2fed09a5d2 100644
--- a/spec/requests/api/runners_spec.rb
+++ b/spec/requests/api/runners_spec.rb
@@ -112,7 +112,7 @@ describe API::Runners do
end
it 'avoids filtering if scope is invalid' do
- get api('/runners?scope=unknown', admin)
+ get api('/runners/all?scope=unknown', admin)
expect(response).to have_gitlab_http_status(400)
end
end
@@ -587,6 +587,22 @@ describe API::Runners do
expect(json_response[0]).to have_key('ip_address')
expect(shared).to be_truthy
end
+
+ it 'filters runners by scope' do
+ get api("/projects/#{project.id}/runners?scope=specific", user)
+
+ shared = json_response.any? { |r| r['is_shared'] }
+ expect(response).to have_gitlab_http_status(200)
+ expect(response).to include_pagination_headers
+ expect(json_response).to be_an Array
+ expect(json_response[0]).to have_key('ip_address')
+ expect(shared).to be_falsey
+ end
+
+ it 'avoids filtering if scope is invalid' do
+ get api("/projects/#{project.id}/runners?scope=unknown", user)
+ expect(response).to have_gitlab_http_status(400)
+ end
end
context 'authorized user without maintainer privileges' do