diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-22 17:28:58 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-25 15:49:59 +0100 |
commit | 40e8185b64a04f719c85a793d0fdd5438a129975 (patch) | |
tree | afbe2bb812256a458467c595a25e44beeb003c9e /spec/requests | |
parent | da0dd7ec96b99eb3e357db2ae8ab4f6d11bfcebb (diff) | |
download | gitlab-ce-40e8185b64a04f719c85a793d0fdd5438a129975.tar.gz |
Expose coverage on GET pipelines/:idzj-expose-coverage-pipelines
The coverage wasn't exposed yet, now it is but only for detailed
requests to save queries on the database.
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/pipelines_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb index d83f7883c78..a7e511aaeda 100644 --- a/spec/requests/api/pipelines_spec.rb +++ b/spec/requests/api/pipelines_spec.rb @@ -103,6 +103,18 @@ describe API::API, api: true do expect(json_response['message']).to eq '404 Not found' expect(json_response['id']).to be nil end + + context 'with coverage' do + before do + create(:ci_build, coverage: 30, pipeline: pipeline) + end + + it 'exposes the coverage' do + get api("/projects/#{project.id}/pipelines/#{pipeline.id}", user) + + expect(json_response["coverage"].to_i).to eq(30) + end + end end context 'unauthorized user' do |