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