Lines 73-79
get '/dbic_merge_sorting' => sub {
Link Here
|
73 |
$attributes = $c->dbic_merge_sorting( |
73 |
$attributes = $c->dbic_merge_sorting( |
74 |
{ |
74 |
{ |
75 |
attributes => $attributes, |
75 |
attributes => $attributes, |
76 |
params => { _match => 'exact', _order_by => 'uno|-dos|+tres' } |
76 |
params => { _match => 'exact', _order_by => [ 'uno', '-dos', '+tres', ' cuatro' ] } |
77 |
} |
77 |
} |
78 |
); |
78 |
); |
79 |
$c->render( json => $attributes, status => 200 ); |
79 |
$c->render( json => $attributes, status => 200 ); |
Lines 117-125
subtest 'dbic_merge_sorting() tests' => sub {
Link Here
|
117 |
|
117 |
|
118 |
my $t = Test::Mojo->new; |
118 |
my $t = Test::Mojo->new; |
119 |
|
119 |
|
120 |
$t->get_ok('/dbic_merge_sorting') |
120 |
$t->get_ok('/dbic_merge_sorting')->status_is(200) |
121 |
->status_is(200) |
|
|
122 |
->json_is( '/a' => 'a', 'Existing values are kept (a)' ) |
121 |
->json_is( '/a' => 'a', 'Existing values are kept (a)' ) |
123 |
->json_is( '/b' => 'b', 'Existing values are kept (b)' ) |
122 |
->json_is( '/b' => 'b', 'Existing values are kept (b)' )->json_is( |
124 |
->json_is( '/order_by' => [ 'uno', { -desc => 'dos' }, { -asc => 'tres' } ] ); |
123 |
'/order_by' => [ |
|
|
124 |
'uno', |
125 |
{ -desc => 'dos' }, |
126 |
{ -asc => 'tres' }, |
127 |
{ -asc => 'cuatro' } |
128 |
] |
129 |
); |
125 |
}; |
130 |
}; |
126 |
- |
|
|