diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-29 03:07:11 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-03 02:11:51 +0900 |
commit | fda48d3091cefeb8c981fcb689ca1ed94f841958 (patch) | |
tree | c4746fcf66ad0ec89d9855b2d86fbc10296e5f65 /spec/finders | |
parent | 7d48cb015d5590cee85fcce863e1a6bb698ab1e4 (diff) | |
download | gitlab-ce-fda48d3091cefeb8c981fcb689ca1ed94f841958.tar.gz |
Improve api/pipelines_spec.rb
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/pipelines_finder_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb index 772c18b22d3..cffe5a46622 100644 --- a/spec/finders/pipelines_finder_spec.rb +++ b/spec/finders/pipelines_finder_spec.rb @@ -28,10 +28,14 @@ describe PipelinesFinder do context 'when scope is finished' do let(:params) { { scope: 'finished' } } - let!(:pipeline) { create(:ci_pipeline, project: project, status: 'success') } + let!(:pipelines) do + [create(:ci_pipeline, project: project, status: 'success'), + create(:ci_pipeline, project: project, status: 'failed'), + create(:ci_pipeline, project: project, status: 'canceled')] + end it 'returns matched pipelines' do - is_expected.to eq([pipeline]) + is_expected.to eq(pipelines.sort_by { |p| -p.id }) end end @@ -168,7 +172,7 @@ describe PipelinesFinder do let(:params) { { order_by: 'user_id', sort: 'asc' } } let!(:pipelines) { create_list(:ci_pipeline, 2, project: project, user: create(:user)) } - it 'sorts as user_id: :desc' do + it 'sorts as user_id: :asc' do is_expected.to eq(pipelines.sort_by { |p| p.user.id }) end |