Lines 330-336
$schema->storage->txn_rollback;
Link Here
|
330 |
|
330 |
|
331 |
subtest 'suspend and resume tests' => sub { |
331 |
subtest 'suspend and resume tests' => sub { |
332 |
|
332 |
|
333 |
plan tests => 20; |
333 |
plan tests => 21; |
334 |
|
334 |
|
335 |
$schema->storage->txn_begin; |
335 |
$schema->storage->txn_begin; |
336 |
|
336 |
|
Lines 359-365
subtest 'suspend and resume tests' => sub {
Link Here
|
359 |
|
359 |
|
360 |
ok( $hold->is_suspended, 'Hold is suspended' ); |
360 |
ok( $hold->is_suspended, 'Hold is suspended' ); |
361 |
$t->json_is( |
361 |
$t->json_is( |
362 |
'/expiration_date', |
362 |
'/end_date', |
363 |
output_pref( |
363 |
output_pref( |
364 |
{ dt => dt_from_string( $hold->suspend_until ), |
364 |
{ dt => dt_from_string( $hold->suspend_until ), |
365 |
dateformat => 'rfc3339', |
365 |
dateformat => 'rfc3339', |
Lines 378-389
subtest 'suspend and resume tests' => sub {
Link Here
|
378 |
"//$userid:$password@/api/v1/holds/" |
378 |
"//$userid:$password@/api/v1/holds/" |
379 |
. $hold->id |
379 |
. $hold->id |
380 |
. "/suspension" => json => { |
380 |
. "/suspension" => json => { |
381 |
expiration_date => |
381 |
end_date => |
382 |
output_pref( { dt => $date, dateformat => 'rfc3339', dateonly => 1 } ) |
382 |
output_pref( { dt => $date, dateformat => 'rfc3339', dateonly => 1 } ) |
383 |
} |
383 |
} |
384 |
)->status_is( 201, 'Hold suspension created' ) |
384 |
)->status_is( 201, 'Hold suspension created' ) |
385 |
->json_is( '/expiration_date', |
385 |
->json_is( '/end_date', |
386 |
output_pref( { dt => $date, dateformat => 'rfc3339', dateonly => 1 } ) ); |
386 |
output_pref( { dt => $date, dateformat => 'rfc3339', dateonly => 1 } ) ) |
|
|
387 |
->header_is( Location => "/api/v1/holds/" . $hold->id . "/suspension", 'The Location header is set' ); |
387 |
|
388 |
|
388 |
$t->delete_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" ) |
389 |
$t->delete_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" ) |
389 |
->status_is( 204, "Correct status when deleting a resource" ) |
390 |
->status_is( 204, "Correct status when deleting a resource" ) |
390 |
- |
|
|