Skip to content

Commit caaa96f

Browse files
committed
Improve test
1 parent ad9e292 commit caaa96f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spec/ajax-datatables-rails/orm/active_record_sort_records_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333
it 'should not sort a column which is not orderable' do
3434
datatable.params[:order]['0'] = { column: '0', dir: 'asc' }
3535
datatable.params[:order]['1'] = { column: '4', dir: 'desc' }
36+
37+
expect(datatable.sort_records(records).to_sql).to include(
38+
'ORDER BY users.username ASC'
39+
)
40+
3641
expect(datatable.sort_records(records).to_sql).to_not include(
37-
'ORDER BY users.username ASC, users.post_id DESC'
42+
'users.post_id DESC'
3843
)
3944
end
4045
end

0 commit comments

Comments
 (0)