summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 12:09:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-07 12:09:13 +0000
commit211a8c3361ccf4eb92f36edbdcf15c98fcdcc8b7 (patch)
tree0ad37172721a39b0d57240bb1b4e70f200a0d93e /spec/models/concerns
parent456a7247f9e88fc2518b69a1a00e905c6db6d775 (diff)
downloadgitlab-ce-211a8c3361ccf4eb92f36edbdcf15c98fcdcc8b7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/sortable_spec.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/models/concerns/sortable_spec.rb b/spec/models/concerns/sortable_spec.rb
index 184f7986a6f..18ac4d19938 100644
--- a/spec/models/concerns/sortable_spec.rb
+++ b/spec/models/concerns/sortable_spec.rb
@@ -4,17 +4,18 @@ require 'spec_helper'
describe Sortable do
describe '.order_by' do
+ let(:arel_table) { Group.arel_table }
let(:relation) { Group.all }
describe 'ordering by id' do
it 'ascending' do
- expect(relation).to receive(:reorder).with(id: :asc)
+ expect(relation).to receive(:reorder).with(arel_table['id'].asc)
relation.order_by('id_asc')
end
it 'descending' do
- expect(relation).to receive(:reorder).with(id: :desc)
+ expect(relation).to receive(:reorder).with(arel_table['id'].desc)
relation.order_by('id_desc')
end
@@ -22,19 +23,19 @@ describe Sortable do
describe 'ordering by created day' do
it 'ascending' do
- expect(relation).to receive(:reorder).with(created_at: :asc)
+ expect(relation).to receive(:reorder).with(arel_table['created_at'].asc)
relation.order_by('created_asc')
end
it 'descending' do
- expect(relation).to receive(:reorder).with(created_at: :desc)
+ expect(relation).to receive(:reorder).with(arel_table['created_at'].desc)
relation.order_by('created_desc')
end
it 'order by "date"' do
- expect(relation).to receive(:reorder).with(created_at: :desc)
+ expect(relation).to receive(:reorder).with(arel_table['created_at'].desc)
relation.order_by('created_date')
end
@@ -66,13 +67,13 @@ describe Sortable do
describe 'ordering by Updated Time' do
it 'ascending' do
- expect(relation).to receive(:reorder).with(updated_at: :asc)
+ expect(relation).to receive(:reorder).with(arel_table['updated_at'].asc)
relation.order_by('updated_asc')
end
it 'descending' do
- expect(relation).to receive(:reorder).with(updated_at: :desc)
+ expect(relation).to receive(:reorder).with(arel_table['updated_at'].desc)
relation.order_by('updated_desc')
end