Commit c79c3895 authored by Shinya Maeda's avatar Shinya Maeda

Fix created_at to user_id in spec

parent e72c50fc
...@@ -206,26 +206,26 @@ describe PipelinesFinder do ...@@ -206,26 +206,26 @@ describe PipelinesFinder do
context 'when order_by and sort are passed' do context 'when order_by and sort are passed' do
context 'when order_by and sort are valid' do context 'when order_by and sort are valid' do
let(:params) { { order_by: 'created_at', sort: 'asc' } } let(:params) { { order_by: 'user_id', sort: 'asc' } }
it 'sorts pipelines by default' do it 'sorts pipelines by default' do
expect(subject).to eq(Ci::Pipeline.order(created_at: :asc)) expect(subject).to eq(Ci::Pipeline.order(user_id: :asc))
end end
end end
context 'when order_by is invalid' do context 'when order_by is invalid' do
let(:params) { { order_by: 'invalid_column', sort: 'desc' } } let(:params) { { order_by: 'invalid_column', sort: 'asc' } }
it 'sorts pipelines with default order_by (id:)' do it 'sorts pipelines with default order_by (id:)' do
expect(subject).to eq(Ci::Pipeline.order(id: :desc)) expect(subject).to eq(Ci::Pipeline.order(id: :asc))
end end
end end
context 'when sort is invalid' do context 'when sort is invalid' do
let(:params) { { order_by: 'created_at', sort: 'invalid_sort' } } let(:params) { { order_by: 'user_id', sort: 'invalid_sort' } }
it 'sorts pipelines with default sort (:desc)' do it 'sorts pipelines with default sort (:desc)' do
expect(subject).to eq(Ci::Pipeline.order(created_at: :desc)) expect(subject).to eq(Ci::Pipeline.order(user_id: :desc))
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment