|
Lines 81-87
subtest 'list() tests' => sub {
Link Here
|
| 81 |
|
81 |
|
| 82 |
subtest 'librarian access tests' => sub { |
82 |
subtest 'librarian access tests' => sub { |
| 83 |
|
83 |
|
| 84 |
plan tests => 21; |
84 |
plan tests => 22; |
| 85 |
|
85 |
|
| 86 |
$schema->storage->txn_begin; |
86 |
$schema->storage->txn_begin; |
| 87 |
|
87 |
|
|
Lines 151-156
subtest 'list() tests' => sub {
Link Here
|
| 151 |
{ 'x-koha-embed' => 'extended_attributes' } ) |
151 |
{ 'x-koha-embed' => 'extended_attributes' } ) |
| 152 |
->status_is( 200, "Works, doesn't explode" ); |
152 |
->status_is( 200, "Works, doesn't explode" ); |
| 153 |
|
153 |
|
|
|
154 |
subtest "embedding 'effective_name'" => sub { |
| 155 |
|
| 156 |
plan tests => 3; |
| 157 |
|
| 158 |
$t->get_ok( "//$userid:$password@/api/v1/patrons?" |
| 159 |
. 'q={"patron_id":"' |
| 160 |
. $patron->id |
| 161 |
. '"}' => { 'x-koha-embed' => 'effective_name' } )->status_is(200) |
| 162 |
->json_is( '/0/effective_name' => $patron->effective_name ); |
| 163 |
}; |
| 164 |
|
| 154 |
subtest 'searching date and date-time fields' => sub { |
165 |
subtest 'searching date and date-time fields' => sub { |
| 155 |
|
166 |
|
| 156 |
plan tests => 12; |
167 |
plan tests => 12; |
|
Lines 264-270
subtest 'get() tests' => sub {
Link Here
|
| 264 |
$schema->storage->txn_rollback; |
275 |
$schema->storage->txn_rollback; |
| 265 |
|
276 |
|
| 266 |
subtest 'librarian access tests' => sub { |
277 |
subtest 'librarian access tests' => sub { |
| 267 |
plan tests => 8; |
278 |
|
|
|
279 |
plan tests => 9; |
| 268 |
|
280 |
|
| 269 |
$schema->storage->txn_begin; |
281 |
$schema->storage->txn_begin; |
| 270 |
|
282 |
|
|
Lines 314-319
subtest 'get() tests' => sub {
Link Here
|
| 314 |
->json_is('/surname' => $patron->surname) |
326 |
->json_is('/surname' => $patron->surname) |
| 315 |
->json_is('/patron_card_lost' => Mojo::JSON->false ); |
327 |
->json_is('/patron_card_lost' => Mojo::JSON->false ); |
| 316 |
|
328 |
|
|
|
329 |
subtest "embedding 'effective_name'" => sub { |
| 330 |
|
| 331 |
plan tests => 3; |
| 332 |
|
| 333 |
$t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id => { 'x-koha-embed' => 'effective_name' } ) |
| 334 |
->status_is(200)->json_is( '/effective_name' => $patron->effective_name ); |
| 335 |
}; |
| 336 |
|
| 317 |
$schema->storage->txn_rollback; |
337 |
$schema->storage->txn_rollback; |
| 318 |
}; |
338 |
}; |
| 319 |
|
339 |
|
| 320 |
- |
|
|