Merge branch 'pipelines-finder-spec-fix' into 'master'

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

See merge request !6291
This commit is contained in:
Robert Speicher 2016-09-10 01:26:32 +00:00
commit d01cbe0c8b
1 changed files with 3 additions and 2 deletions

View File

@ -43,9 +43,10 @@ describe PipelinesFinder do
let(:params) { { scope: 'running' } } let(:params) { { scope: 'running' } }
it 'orders in descending order on ID' do 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 end
end end