|
Lines 169-175
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
| 169 |
}; |
169 |
}; |
| 170 |
|
170 |
|
| 171 |
subtest 'build_query tests' => sub { |
171 |
subtest 'build_query tests' => sub { |
| 172 |
plan tests => 33; |
172 |
plan tests => 34; |
| 173 |
|
173 |
|
| 174 |
my $qb; |
174 |
my $qb; |
| 175 |
|
175 |
|
|
Lines 196-201
subtest 'build_query tests' => sub {
Link Here
|
| 196 |
"sort parameter properly formed" |
196 |
"sort parameter properly formed" |
| 197 |
); |
197 |
); |
| 198 |
|
198 |
|
|
|
199 |
# FIXME |
| 200 |
# All of our sort fields currently use 'phrase' |
| 201 |
# Integer fields shoud probably be structured differently |
| 202 |
# But for now we should make sure they work |
| 203 |
my @int_sort_by = 'popularity_asc'; |
| 204 |
my @int_sort_params = $qb->_convert_sort_fields(@int_sort_by); |
| 205 |
my %int_options; |
| 206 |
$int_options{sort} = \@int_sort_params; |
| 207 |
my $int_query = $qb->build_query('test', %int_options); |
| 208 |
|
| 209 |
is_deeply( |
| 210 |
$int_query->{sort}, |
| 211 |
[ |
| 212 |
{ |
| 213 |
'issues__sort.phrase' => { |
| 214 |
'order' => 'asc' |
| 215 |
} |
| 216 |
} |
| 217 |
], |
| 218 |
"sort parameter properly formed" |
| 219 |
); |
| 220 |
|
| 199 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
221 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
| 200 |
$query = $qb->build_query(); |
222 |
$query = $qb->build_query(); |
| 201 |
ok( defined $query->{aggregations}{homebranch}, |
223 |
ok( defined $query->{aggregations}{homebranch}, |
| 202 |
- |
|
|