diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-07-20 18:06:35 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-07-20 18:06:35 +0800 |
commit | 2fe8ebc143737390ea8ba952ad1b8ba4c82dae84 (patch) | |
tree | f51e495fd0c95cd14454e00e3d8a233c8d0b14b2 /spec | |
parent | 3925436a9582ec35c0eb4fddaeeaf71c23076754 (diff) | |
download | gitlab-ce-2fe8ebc143737390ea8ba952ad1b8ba4c82dae84.tar.gz |
We need INNER JOIN to get the right pipeline,
also added a test for checking this.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/builds_spec.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/requests/api/builds_spec.rb b/spec/requests/api/builds_spec.rb index c2541346a51..553b432c7c7 100644 --- a/spec/requests/api/builds_spec.rb +++ b/spec/requests/api/builds_spec.rb @@ -256,14 +256,17 @@ describe API::API, api: true do context 'with latest pipeline' do before do - pipelines = Array.new(3).map do # creating some old pipelines + old_pipelines = Array.new(3).map do # creating some old pipelines create(:ci_pipeline, status: 'success') end - pipelines.reverse_each do |pipe| - new_build = create(:ci_build, :success, pipeline: pipe) - new_build.update(artifacts_file: another_artifacts) + old_pipelines.reverse_each do |pipe| + old_build = create(:ci_build, :success, pipeline: pipe) + old_build.update(artifacts_file: another_artifacts) end + + wrong_build = create(:ci_build, :success, pipeline: pipeline) + wrong_build.update(artifacts_file: another_artifacts) end before do |