diff options
author | Mehdi Lahmam <mehdi@lahmam.com> | 2017-08-14 00:11:48 +0300 |
---|---|---|
committer | Mehdi Lahmam <mehdi@lahmam.com> | 2017-11-05 23:59:58 +0300 |
commit | 08bc2f946bc788b8a51e7a4136cc83e57d9f707a (patch) | |
tree | 848cb042f2b74c57820fa5dbd776e73cee295457 /spec/requests/api/jobs_spec.rb | |
parent | 1d5f2f9c333534b7004501bcfa52ca873d6a3403 (diff) |
Expose `duration` in Job API entity
Closes #35794.
Diffstat (limited to 'spec/requests/api/jobs_spec.rb')
-rw-r--r-- | spec/requests/api/jobs_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index 3b7b9c889e7..1765907c1b4 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -165,7 +165,17 @@ describe API::Jobs do context 'authorized user' do it 'returns specific job data' do expect(response).to have_gitlab_http_status(200) - expect(json_response['name']).to eq('test') + expect(json_response['id']).to eq(job.id) + expect(json_response['status']).to eq(job.status) + expect(json_response['stage']).to eq(job.stage) + expect(json_response['name']).to eq(job.name) + expect(json_response['ref']).to eq(job.ref) + expect(json_response['tag']).to eq(job.tag) + expect(json_response['coverage']).to eq(job.coverage) + expect(Time.parse(json_response['created_at'])).to be_like_time(job.created_at) + expect(Time.parse(json_response['started_at'])).to be_like_time(job.started_at) + expect(Time.parse(json_response['finished_at'])).to be_like_time(job.finished_at) + expect(json_response['duration']).to eq(job.duration) end it 'returns pipeline data' do |