Lines 230-236
subtest 'list() tests' => sub {
Link Here
|
230 |
|
230 |
|
231 |
subtest 'get() tests' => sub { |
231 |
subtest 'get() tests' => sub { |
232 |
|
232 |
|
233 |
plan tests => 3; |
233 |
plan tests => 4; |
234 |
|
234 |
|
235 |
$schema->storage->txn_begin; |
235 |
$schema->storage->txn_begin; |
236 |
unauthorized_access_tests('GET', -1, undef); |
236 |
unauthorized_access_tests('GET', -1, undef); |
Lines 315-320
subtest 'get() tests' => sub {
Link Here
|
315 |
|
315 |
|
316 |
$schema->storage->txn_rollback; |
316 |
$schema->storage->txn_rollback; |
317 |
}; |
317 |
}; |
|
|
318 |
|
319 |
subtest '+strings' => sub { |
320 |
|
321 |
plan tests => 4; |
322 |
|
323 |
$schema->storage->txn_begin; |
324 |
|
325 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
326 |
|
327 |
my $librarian = $builder->build_object( |
328 |
{ |
329 |
class => 'Koha::Patrons', |
330 |
value => { flags => 2**4 } # borrowers flag = 4 |
331 |
} |
332 |
); |
333 |
my $password = 'thePassword123'; |
334 |
$librarian->set_password( { password => $password, skip_validation => 1 } ); |
335 |
my $userid = $librarian->userid; |
336 |
|
337 |
$t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id => { "x-koha-embed" => "+strings" } ) |
338 |
->status_is(200) |
339 |
->json_has( '/_strings/library_id' => { str => $patron->library->branchname, type => 'library' } ) |
340 |
->json_has( |
341 |
'/_strings/category_id' => { str => $patron->category->description, type => 'patron_category' } ); |
342 |
|
343 |
$schema->storage->txn_rollback; |
344 |
}; |
318 |
}; |
345 |
}; |
319 |
|
346 |
|
320 |
subtest 'add() tests' => sub { |
347 |
subtest 'add() tests' => sub { |
321 |
- |
|
|