Lines 110-117
subtest 'volumes add() tests' => sub {
Link Here
|
110 |
->status_is( 201, 'SWAGGER3.2.1' ); |
110 |
->status_is( 201, 'SWAGGER3.2.1' ); |
111 |
|
111 |
|
112 |
# Invalid biblio id |
112 |
# Invalid biblio id |
113 |
$t->post_ok( "//$auth_userid:$password@/api/v1/biblios/XXX/volumes" => json => $volume ) |
113 |
{ # hide useless warnings |
114 |
->status_is( 409, 'SWAGGER3.2.1' ); |
114 |
local *STDERR; |
|
|
115 |
open STDERR, '>', '/dev/null'; |
116 |
$t->post_ok( "//$auth_userid:$password@/api/v1/biblios/XXX/volumes" => json => $volume ) |
117 |
->status_is( 404 ); |
118 |
close STDERR; |
119 |
} |
115 |
|
120 |
|
116 |
$schema->storage->txn_rollback; |
121 |
$schema->storage->txn_rollback; |
117 |
}; |
122 |
}; |
Lines 196-205
subtest 'volumes delete() tests' => sub {
Link Here
|
196 |
->status_is(403); |
201 |
->status_is(403); |
197 |
|
202 |
|
198 |
$t->delete_ok( "//$auth_userid:$password@/api/v1/biblios/XXX/volumes/$volume_id" ) |
203 |
$t->delete_ok( "//$auth_userid:$password@/api/v1/biblios/XXX/volumes/$volume_id" ) |
199 |
->status_is(404); |
204 |
->status_is(404); |
200 |
|
205 |
|
201 |
$t->delete_ok( "//$auth_userid:$password@/api/v1/biblios/$biblio_id/volumes/XXX" ) |
206 |
$t->delete_ok( "//$auth_userid:$password@/api/v1/biblios/$biblio_id/volumes/XXX" ) |
202 |
->status_is(404); |
207 |
->status_is(404); |
203 |
|
208 |
|
204 |
$schema->storage->txn_rollback; |
209 |
$schema->storage->txn_rollback; |
205 |
}; |
210 |
}; |
Lines 239-251
subtest 'volume items add() + delete() tests' => sub {
Link Here
|
239 |
my $item_2_id = $item_2->id; |
244 |
my $item_2_id = $item_2->id; |
240 |
|
245 |
|
241 |
$t->post_ok( "//$userid:$password@/api/v1/biblios/{biblio_id}/volumes/$volume_id/items" => json => { item_id => $item_2->id } ) |
246 |
$t->post_ok( "//$userid:$password@/api/v1/biblios/{biblio_id}/volumes/$volume_id/items" => json => { item_id => $item_2->id } ) |
242 |
->status_is( 201, 'SWAGGER3.2.1' ); |
247 |
->status_is( 201, 'SWAGGER3.2.1' ); |
243 |
|
248 |
|
244 |
@items = $volume->items; |
249 |
@items = $volume->items; |
245 |
is( scalar(@items), 2, 'Volume now has two items'); |
250 |
is( scalar(@items), 2, 'Volume now has two items'); |
246 |
|
251 |
|
247 |
warn "A VOLUME ID: $volume_id"; |
|
|
248 |
warn "A ITEM ID: $item_1_id"; |
249 |
$t->delete_ok( "//$userid:$password@/api/v1/biblios/$biblio_id/volumes/$volume_id/items/$item_1_id" ) |
252 |
$t->delete_ok( "//$userid:$password@/api/v1/biblios/$biblio_id/volumes/$volume_id/items/$item_1_id" ) |
250 |
->status_is(204, 'SWAGGER3.2.4') |
253 |
->status_is(204, 'SWAGGER3.2.4') |
251 |
->content_is('', 'SWAGGER3.3.4'); |
254 |
->content_is('', 'SWAGGER3.3.4'); |
252 |
- |
|
|