Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-09-09 23:21:46 +0300
committerStan Hu <stanhu@gmail.com>2016-09-09 23:21:46 +0300
commite300e9d5ef032aa6543f471dcea37ba068c98a5e (patch)
tree90083c283dbc90c5aef2a3c0e9060f9dc421dd5a /spec/finders/pipelines_finder_spec.rb
parent796bdf1dcb86b5e77fc054208afc632f75518605 (diff)
Improve PipelinesFinder spec so that it does not depend on hard-coded database IDs
Fixes failed builds such as https://gitlab.com/gitlab-org/gitlab-ce/builds/3919501
Diffstat (limited to 'spec/finders/pipelines_finder_spec.rb')
-rw-r--r--spec/finders/pipelines_finder_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb
index 7100266ab55..b0811d134fa 100644
--- a/spec/finders/pipelines_finder_spec.rb
+++ b/spec/finders/pipelines_finder_spec.rb
@@ -43,9 +43,10 @@ describe PipelinesFinder do
let(:params) { { scope: 'running' } }
it 'orders in descending order on ID' do
- create(:ci_pipeline, project: project, ref: 'feature')
+ feature_pipeline = create(:ci_pipeline, project: project, ref: 'feature')
- expect(subject.map(&:id)).to eq [3, 2, 1]
+ expected_ids = [feature_pipeline.id, branch_pipeline.id, tag_pipeline.id].sort.reverse
+ expect(subject.map(&:id)).to eq expected_ids
end
end
end