diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-22 08:53:05 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-28 11:34:49 +0200 |
commit | 8e66618749613333c9201a6ffaf7fc67633cc055 (patch) | |
tree | ef102257e87a32c5c317a1202b0bc96858e831c1 /spec/requests | |
parent | 2c3f3cb3920c5242cbc66456b3eed423636a2128 (diff) | |
download | gitlab-ce-8e66618749613333c9201a6ffaf7fc67633cc055.tar.gz |
Find all builds for commit if multiple pipelines
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/builds_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/requests/api/builds_spec.rb b/spec/requests/api/builds_spec.rb index 2ab9d640269..e9948b0afa2 100644 --- a/spec/requests/api/builds_spec.rb +++ b/spec/requests/api/builds_spec.rb @@ -64,14 +64,18 @@ describe API::API, api: true do describe 'GET /projects/:id/repository/commits/:sha/builds' do before do - project.ensure_pipeline(pipeline.sha, 'master') - get api("/projects/#{project.id}/repository/commits/#{pipeline.sha}/builds", api_user) + create(:ci_pipeline, project: project, sha: project.commit.id) + create(:ci_build, pipeline: pipeline) + create(:ci_build) + + get api("/projects/#{project.id}/repository/commits/#{project.commit.id}/builds", api_user) end context 'authorized user' do it 'should return project builds for specific commit' do expect(response).to have_http_status(200) expect(json_response).to be_an Array + expect(json_response.size).to eq 2 end end |