Lines 370-376
$schema->storage->txn_rollback;
Link Here
|
370 |
|
370 |
|
371 |
subtest 'suspend and resume tests' => sub { |
371 |
subtest 'suspend and resume tests' => sub { |
372 |
|
372 |
|
373 |
plan tests => 21; |
373 |
plan tests => 24; |
374 |
|
374 |
|
375 |
$schema->storage->txn_begin; |
375 |
$schema->storage->txn_begin; |
376 |
|
376 |
|
Lines 397-411
subtest 'suspend and resume tests' => sub {
Link Here
|
397 |
|
397 |
|
398 |
$hold->discard_changes; # refresh object |
398 |
$hold->discard_changes; # refresh object |
399 |
|
399 |
|
|
|
400 |
ok( $hold->is_suspended, 'Hold is suspended' ); |
401 |
$t->json_is('/end_date', undef, 'Hold suspension has no end date'); |
402 |
|
403 |
my $end_date = output_pref({ |
404 |
dt => dt_from_string( undef ), |
405 |
dateformat => 'rfc3339', |
406 |
dateonly => 1 |
407 |
}); |
408 |
|
409 |
$t->post_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" => json => { end_date => $end_date } ); |
410 |
|
411 |
$hold->discard_changes; # refresh object |
412 |
|
400 |
ok( $hold->is_suspended, 'Hold is suspended' ); |
413 |
ok( $hold->is_suspended, 'Hold is suspended' ); |
401 |
$t->json_is( |
414 |
$t->json_is( |
402 |
'/end_date', |
415 |
'/end_date', |
403 |
output_pref( |
416 |
output_pref({ |
404 |
{ dt => dt_from_string( $hold->suspend_until ), |
417 |
dt => dt_from_string( $hold->suspend_until ), |
405 |
dateformat => 'rfc3339', |
418 |
dateformat => 'rfc3339', |
406 |
dateonly => 1 |
419 |
dateonly => 1 |
407 |
} |
420 |
}), |
408 |
) |
421 |
'Hold suspension has correct end date' |
409 |
); |
422 |
); |
410 |
|
423 |
|
411 |
$t->delete_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" ) |
424 |
$t->delete_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" ) |
412 |
- |
|
|