diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-27 16:23:06 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-02 20:11:51 +0300 |
commit | 4fe7c25556c7343e46369ffc1e72db1346cc1360 (patch) | |
tree | e9b6dadf37d366544d1bca8e262e3c057a322193 | |
parent | 255bfd658340e36a882108d4a9911d7f9cde638d (diff) |
Improve pipelines_finder.rb
-rw-r--r-- | spec/finders/pipelines_finder_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb index 3b04100ff57..f2aeda241c1 100644 --- a/spec/finders/pipelines_finder_spec.rb +++ b/spec/finders/pipelines_finder_spec.rb @@ -11,7 +11,7 @@ describe PipelinesFinder do let!(:pipelines) { create_list(:ci_pipeline, 2, project: project) } it 'returns all pipelines' do - is_expected.to eq(pipelines.sort_by { |p| -p.id }) + is_expected.to match_array(pipelines) end end @@ -35,7 +35,7 @@ describe PipelinesFinder do end it 'returns matched pipelines' do - is_expected.to eq(pipelines.sort_by { |p| -p.id }) + is_expected.to match_array(pipelines) end end @@ -162,7 +162,7 @@ describe PipelinesFinder do let(:params) { { yaml_errors: "invalid-yaml_errors" } } it 'returns all pipelines' do - is_expected.to eq([pipeline1, pipeline2].sort_by { |p| -p.id }) + is_expected.to match_array([pipeline1, pipeline2]) end end end @@ -173,7 +173,7 @@ describe PipelinesFinder do let!(:pipelines) { create_list(:ci_pipeline, 2, project: project, user: create(:user)) } it 'sorts as user_id: :asc' do - is_expected.to eq(pipelines.sort_by { |p| p.user.id }) + is_expected.to match_array(pipelines) end context 'when sort is invalid' do |