3 class Arvados::V1::QueryTest < ActionController::TestCase
4 test 'no fallback orders when order is unambiguous' do
5 @controller = Arvados::V1::LogsController.new
11 assert_response :success
12 assert_equal ['logs.id asc'], assigns(:objects).order_values
15 test 'fallback orders when order is ambiguous' do
16 @controller = Arvados::V1::LogsController.new
17 authorize_with :active
19 order: ['event_type asc'],
22 assert_response :success
23 assert_equal('logs.event_type asc, logs.modified_at desc, logs.uuid',
24 assigns(:objects).order_values.join(', '))
27 test 'skip fallback orders already given by client' do
28 @controller = Arvados::V1::LogsController.new
29 authorize_with :active
31 order: ['modified_at asc'],
34 assert_response :success
35 assert_equal('logs.modified_at asc, logs.uuid',
36 assigns(:objects).order_values.join(', '))
39 test 'eliminate superfluous orders' do
40 @controller = Arvados::V1::LogsController.new
41 authorize_with :active
43 order: ['logs.modified_at asc',
46 'logs.event_type asc'],
49 assert_response :success
50 assert_equal('logs.modified_at asc, logs.event_type desc, logs.uuid',
51 assigns(:objects).order_values.join(', '))
54 test 'eliminate orders after the first unique column' do
55 @controller = Arvados::V1::LogsController.new
56 authorize_with :active
58 order: ['event_type asc',
64 assert_response :success
65 assert_equal('logs.event_type asc, logs.id asc',
66 assigns(:objects).order_values.join(', '))