|
Lines 255-260
get '/stash_embed_no_spec' => sub {
Link Here
|
| 255 |
}; |
255 |
}; |
| 256 |
}; |
256 |
}; |
| 257 |
|
257 |
|
|
|
258 |
get '/stash_overrides' => sub { |
| 259 |
my $c = shift; |
| 260 |
|
| 261 |
$c->stash_overrides(); |
| 262 |
my $overrides = $c->stash('koha.overrides'); |
| 263 |
|
| 264 |
$c->render( |
| 265 |
status => 200, |
| 266 |
json => $overrides |
| 267 |
); |
| 268 |
}; |
| 269 |
|
| 258 |
sub to_model { |
270 |
sub to_model { |
| 259 |
my ($args) = @_; |
271 |
my ($args) = @_; |
| 260 |
$args->{three} = delete $args->{tres} |
272 |
$args->{three} = delete $args->{tres} |
|
Lines 264-270
sub to_model {
Link Here
|
| 264 |
|
276 |
|
| 265 |
# The tests |
277 |
# The tests |
| 266 |
|
278 |
|
| 267 |
use Test::More tests => 6; |
279 |
use Test::More tests => 7; |
| 268 |
use Test::Mojo; |
280 |
use Test::Mojo; |
| 269 |
|
281 |
|
| 270 |
subtest 'extract_reserved_params() tests' => sub { |
282 |
subtest 'extract_reserved_params() tests' => sub { |
|
Lines 487-489
subtest 'stash_embed() tests' => sub {
Link Here
|
| 487 |
); |
499 |
); |
| 488 |
|
500 |
|
| 489 |
}; |
501 |
}; |
| 490 |
- |
502 |
|
|
|
503 |
subtest 'stash_overrides() tests' => sub { |
| 504 |
|
| 505 |
plan tests => 4; |
| 506 |
|
| 507 |
my $t = Test::Mojo->new; |
| 508 |
|
| 509 |
$t->get_ok( '/stash_overrides' => { 'x-koha-override' => 'any,none,some_other,any,' } ) |
| 510 |
->json_is( { 'any' => 1, 'none' => 1, 'some_other' => 1 } ); # empty string and duplicates are skipped |
| 511 |
|
| 512 |
$t->get_ok( '/stash_overrides' => { 'x-koha-override' => '' } ) |
| 513 |
->json_is( {} ); # empty string is skipped |
| 514 |
}; |