Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 3; |
20 |
use Test::More tests => 4; |
21 |
use Test::Mojo; |
21 |
use Test::Mojo; |
22 |
|
22 |
|
23 |
use Module::Load::Conditional qw(can_load); |
23 |
use Module::Load::Conditional qw(can_load); |
Lines 192-197
subtest 'anonymous requests to public API' => sub {
Link Here
|
192 |
$schema->storage->txn_rollback; |
192 |
$schema->storage->txn_rollback; |
193 |
}; |
193 |
}; |
194 |
|
194 |
|
|
|
195 |
subtest 'public routes have "is_public" info stashed' => sub { |
196 |
|
197 |
plan tests => 2; |
198 |
|
199 |
$schema->storage->txn_begin; |
200 |
|
201 |
my $stash; |
202 |
$t->app->hook( |
203 |
after_dispatch => sub { |
204 |
$stash = shift->stash; |
205 |
} |
206 |
); |
207 |
|
208 |
$t->get_ok('/api/v1/public/biblios/1'); |
209 |
|
210 |
my $is_public = $stash->{is_public}; |
211 |
|
212 |
ok( $is_public, 'Correctly stashed the fact it is a public route' ); |
213 |
|
214 |
$schema->storage->txn_rollback; |
215 |
}; |
216 |
|
195 |
sub create_user_and_session { |
217 |
sub create_user_and_session { |
196 |
|
218 |
|
197 |
my $args = shift; |
219 |
my $args = shift; |
198 |
- |
|
|