Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-05-09 15:13:54 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2018-05-09 15:13:54 +0300
commit8516e3a4b7b62027ee80853008f53517374ff105 (patch)
treea629fc8f5621545b968d52e2f0df2e94a265dea5 /spec/requests
parentb63cd070b592559d86205708eaa3feb788dac921 (diff)
Support 'active' setting on Runner Registration API endpoint
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/runner_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 082605827b7..da392c5ab81 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -41,6 +41,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
expect(json_response['id']).to eq(runner.id)
expect(json_response['token']).to eq(runner.token)
expect(runner.run_untagged).to be true
+ expect(runner.active).to be true
expect(runner.token).not_to eq(registration_token)
expect(runner).to be_instance_type
end
@@ -129,6 +130,28 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end
end
+ context 'when option for activating a Runner is provided' do
+ context 'when active is set to true' do
+ it 'creates runner' do
+ post api('/runners'), token: registration_token,
+ active: true
+
+ expect(response).to have_gitlab_http_status 201
+ expect(Ci::Runner.first.active).to be true
+ end
+ end
+
+ context 'when active is set to false' do
+ it 'creates runner' do
+ post api('/runners'), token: registration_token,
+ active: false
+
+ expect(response).to have_gitlab_http_status 201
+ expect(Ci::Runner.first.active).to be false
+ end
+ end
+ end
+
context 'when maximum job timeout is specified' do
it 'creates runner' do
post api('/runners'), token: registration_token,