diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-02-28 22:56:35 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 14:57:18 +0300 |
commit | dbd7455583a10679f0e365cfeacd4729a4b543ec (patch) | |
tree | 5a9b6da4f80b90ef8ec372fecc555b97c2a91cc8 /spec/requests | |
parent | 7ef24a47714802edd8ad5470a6147b60172a0a28 (diff) |
Use _human_readable for Runner's registration API
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index a6a4f510406..55c4150a393 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -112,10 +112,20 @@ describe API::Runner do context 'when maximum job timeout is specified' do it 'creates runner' do post api('/runners'), token: registration_token, - maximum_job_timeout: 7200 + maximum_job_timeout_human_readable: '2h 30m' expect(response).to have_gitlab_http_status 201 - expect(Ci::Runner.first.maximum_job_timeout).to eq(7200) + expect(Ci::Runner.first.maximum_job_timeout).to eq(9000) + end + + context 'when maximum job timeout is empty' do + it 'creates runner' do + post api('/runners'), token: registration_token, + maximum_job_timeout_human_readable: '' + + expect(response).to have_gitlab_http_status 201 + expect(Ci::Runner.first.maximum_job_timeout).to be_nil + end end end |