diff options
author | zelin-l <16577660+zelin-l@users.noreply.github.com> | 2019-04-18 16:06:53 +0300 |
---|---|---|
committer | zelin-l <16577660+zelin-l@users.noreply.github.com> | 2019-04-18 16:57:12 +0300 |
commit | 52c19d4da7830c9c39d23190822d3c2de80d13a4 (patch) | |
tree | 17300e81a46eb58a072855388702fe908be176b7 /spec/requests | |
parent | 7a4b4cffba0313ada14b012dae05f31ecb17154d (diff) |
Add configuration of access_level for runners on registration via API
Allow setting access_level of new runner to not_protected (default) or ref_protected
Minor update to relevant docs and tests
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 3585a827838..29515709a74 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -168,6 +168,32 @@ describe API::Runner, :clean_gitlab_redis_shared_state do end end + context 'when access_level is provided for Runner' do + context 'when access_level is set to ref_protected' do + it 'creates runner' do + post api('/runners'), params: { + token: registration_token, + access_level: 'ref_protected' + } + + expect(response).to have_gitlab_http_status 201 + expect(Ci::Runner.first.ref_protected?).to be true + end + end + + context 'when access_level is set to not_protected' do + it 'creates runner' do + post api('/runners'), params: { + token: registration_token, + access_level: 'not_protected' + } + + expect(response).to have_gitlab_http_status 201 + expect(Ci::Runner.first.ref_protected?).to be false + end + end + end + context 'when maximum job timeout is specified' do it 'creates runner' do post api('/runners'), params: { |