|
Lines 439-445
subtest 'get_availability' => sub {
Link Here
|
| 439 |
|
439 |
|
| 440 |
subtest 'add checkout' => sub { |
440 |
subtest 'add checkout' => sub { |
| 441 |
|
441 |
|
| 442 |
plan tests => 10; |
442 |
plan tests => 12; |
| 443 |
|
443 |
|
| 444 |
$schema->storage->txn_begin; |
444 |
$schema->storage->txn_begin; |
| 445 |
my $librarian = $builder->build_object( |
445 |
my $librarian = $builder->build_object( |
|
Lines 465-472
subtest 'add checkout' => sub {
Link Here
|
| 465 |
|
465 |
|
| 466 |
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; |
466 |
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; |
| 467 |
|
467 |
|
| 468 |
my $item1 = $builder->build_sample_item; |
468 |
my $item1 = $builder->build_sample_item; |
| 469 |
my $item1_id = $item1->id; |
469 |
my $item1_id = $item1->id; |
|
|
470 |
my $item1_barcode = $item1->barcode; |
| 470 |
|
471 |
|
| 471 |
my %issuingimpossible = (); |
472 |
my %issuingimpossible = (); |
| 472 |
my %needsconfirmation = (); |
473 |
my %needsconfirmation = (); |
|
Lines 491-496
subtest 'add checkout' => sub {
Link Here
|
| 491 |
$t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { item_id => $item1_id, patron_id => $patron_id } ) |
492 |
$t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { item_id => $item1_id, patron_id => $patron_id } ) |
| 492 |
->status_is(201); |
493 |
->status_is(201); |
| 493 |
|
494 |
|
|
|
495 |
$t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { external_id => $item1_barcode, patron_id => $patron_id } ) |
| 496 |
->status_is(201); |
| 497 |
|
| 498 |
|
| 494 |
# Needs confirm |
499 |
# Needs confirm |
| 495 |
%needsconfirmation = ( confirm1 => 1, confirm2 => 'please' ); |
500 |
%needsconfirmation = ( confirm1 => 1, confirm2 => 'please' ); |
| 496 |
$t->post_ok( |
501 |
$t->post_ok( |
| 497 |
- |
|
|