Lines 157-163
my $post_data = {
Link Here
|
157 |
biblio_id => int($biblio_1->biblionumber), |
157 |
biblio_id => int($biblio_1->biblionumber), |
158 |
item_id => int($item_1->itemnumber), |
158 |
item_id => int($item_1->itemnumber), |
159 |
pickup_library_id => $branchcode, |
159 |
pickup_library_id => $branchcode, |
160 |
expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 }), |
160 |
expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339' }), |
161 |
priority => 2, |
161 |
priority => 2, |
162 |
}; |
162 |
}; |
163 |
my $put_data = { |
163 |
my $put_data = { |
Lines 273-279
subtest "Test endpoints with permission" => sub {
Link Here
|
273 |
$t->get_ok( "//$userid_1:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) |
273 |
$t->get_ok( "//$userid_1:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber ) |
274 |
->status_is(200) |
274 |
->status_is(200) |
275 |
->json_is('/0/hold_id', $reserve_id) |
275 |
->json_is('/0/hold_id', $reserve_id) |
276 |
->json_is('/0/expiration_date', output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 })) |
276 |
->json_is('/0/expiration_date', output_pref({ dt => $expiration_date, dateformat => 'rfc3339' })) |
277 |
->json_is('/0/pickup_library_id', $branchcode); |
277 |
->json_is('/0/pickup_library_id', $branchcode); |
278 |
|
278 |
|
279 |
$t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) |
279 |
$t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) |
Lines 342-349
subtest 'test AllowHoldDateInFuture' => sub {
Link Here
|
342 |
biblio_id => int($biblio_1->biblionumber), |
342 |
biblio_id => int($biblio_1->biblionumber), |
343 |
item_id => int($item_1->itemnumber), |
343 |
item_id => int($item_1->itemnumber), |
344 |
pickup_library_id => $branchcode, |
344 |
pickup_library_id => $branchcode, |
345 |
expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 }), |
345 |
expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339' }), |
346 |
hold_date => output_pref({ dt => $future_hold_date, dateformat => 'rfc3339', dateonly => 1 }), |
346 |
hold_date => output_pref({ dt => $future_hold_date, dateformat => 'rfc3339' }), |
347 |
priority => 2, |
347 |
priority => 2, |
348 |
}; |
348 |
}; |
349 |
|
349 |
|
Lines 357-363
subtest 'test AllowHoldDateInFuture' => sub {
Link Here
|
357 |
|
357 |
|
358 |
$t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) |
358 |
$t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) |
359 |
->status_is(201) |
359 |
->status_is(201) |
360 |
->json_is('/hold_date', output_pref({ dt => $future_hold_date, dateformat => 'rfc3339', dateonly => 1 })); |
360 |
->json_is('/hold_date', output_pref({ dt => $future_hold_date, dateformat => 'rfc3339' })); |
361 |
}; |
361 |
}; |
362 |
|
362 |
|
363 |
subtest 'test AllowHoldPolicyOverride' => sub { |
363 |
subtest 'test AllowHoldPolicyOverride' => sub { |
Lines 425-431
subtest 'suspend and resume tests' => sub {
Link Here
|
425 |
my $end_date = output_pref({ |
425 |
my $end_date = output_pref({ |
426 |
dt => dt_from_string( undef ), |
426 |
dt => dt_from_string( undef ), |
427 |
dateformat => 'rfc3339', |
427 |
dateformat => 'rfc3339', |
428 |
dateonly => 1 |
428 |
dateonly => 1 |
429 |
}); |
429 |
}); |
430 |
|
430 |
|
431 |
$t->post_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" => json => { end_date => $end_date } ); |
431 |
$t->post_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" => json => { end_date => $end_date } ); |
Lines 438-444
subtest 'suspend and resume tests' => sub {
Link Here
|
438 |
output_pref({ |
438 |
output_pref({ |
439 |
dt => dt_from_string( $hold->suspend_until ), |
439 |
dt => dt_from_string( $hold->suspend_until ), |
440 |
dateformat => 'rfc3339', |
440 |
dateformat => 'rfc3339', |
441 |
dateonly => 1 |
441 |
dateonly => 1 |
442 |
}), |
442 |
}), |
443 |
'Hold suspension has correct end date' |
443 |
'Hold suspension has correct end date' |
444 |
); |
444 |
); |
445 |
- |
|
|