summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-20 18:06:35 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-20 18:06:35 +0800
commit2fe8ebc143737390ea8ba952ad1b8ba4c82dae84 (patch)
treef51e495fd0c95cd14454e00e3d8a233c8d0b14b2 /spec
parent3925436a9582ec35c0eb4fddaeeaf71c23076754 (diff)
downloadgitlab-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.rb11
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