|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 1; |
20 |
use Test::More tests => 2; |
| 21 |
use Test::Mojo; |
21 |
use Test::Mojo; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
|
23 |
|
|
Lines 107-112
subtest 'under() tests' => sub {
Link Here
|
| 107 |
$schema->storage->txn_rollback; |
107 |
$schema->storage->txn_rollback; |
| 108 |
}; |
108 |
}; |
| 109 |
|
109 |
|
|
|
110 |
subtest 'CORS support' => sub { |
| 111 |
|
| 112 |
plan tests => 6; |
| 113 |
|
| 114 |
t::lib::Mocks::mock_preference('AccessControlAllowOrigin',''); |
| 115 |
$t->get_ok("/api/v1/patrons") |
| 116 |
->header_is( 'Access-control-allow-origin', undef, 'Header not returned' ); |
| 117 |
# FIXME: newer Test::Mojo has header_exists_not |
| 118 |
|
| 119 |
t::lib::Mocks::mock_preference('AccessControlAllowOrigin',undef); |
| 120 |
$t->get_ok("/api/v1/patrons") |
| 121 |
->header_is( 'Access-control-allow-origin', undef, 'Header not returned' ); |
| 122 |
# FIXME: newer Test::Mojo has header_exists_not |
| 123 |
|
| 124 |
t::lib::Mocks::mock_preference('AccessControlAllowOrigin','*'); |
| 125 |
$t->get_ok("/api/v1/patrons") |
| 126 |
->header_is( 'Access-control-allow-origin', '*', 'Header set' ); |
| 127 |
}; |
| 128 |
|
| 110 |
sub create_user_and_session { |
129 |
sub create_user_and_session { |
| 111 |
my $user = $builder->build( |
130 |
my $user = $builder->build( |
| 112 |
{ |
131 |
{ |
| 113 |
- |
|
|