diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-19 11:47:26 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-19 11:47:26 +0300 |
commit | 604cfb17a79b203dca7a2c56e84b58f8e819effd (patch) | |
tree | 10a8b509aa26bef62104dd741cad24fceb773c7a /spec/requests | |
parent | d8d57f23b26df6c0d07fc7911edee16a70a775f0 (diff) | |
parent | 52c19d4da7830c9c39d23190822d3c2de80d13a4 (diff) |
Merge branch 'protected-runner-registration' into 'master'
Add configuration of access_level for runners on registration via API
See merge request gitlab-org/gitlab-ce!27490
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: { |