Lines 1500-1506
subtest 'delete() tests' => sub {
Link Here
|
1500 |
|
1500 |
|
1501 |
subtest 'PUT /holds/{hold_id}/lowest_priority tests' => sub { |
1501 |
subtest 'PUT /holds/{hold_id}/lowest_priority tests' => sub { |
1502 |
|
1502 |
|
1503 |
plan tests => 5; |
1503 |
plan tests => 8; |
1504 |
|
1504 |
|
1505 |
$schema->storage->txn_begin; |
1505 |
$schema->storage->txn_begin; |
1506 |
|
1506 |
|
Lines 1541-1551
subtest 'PUT /holds/{hold_id}/lowest_priority tests' => sub {
Link Here
|
1541 |
) |
1541 |
) |
1542 |
); |
1542 |
); |
1543 |
|
1543 |
|
1544 |
$t->put_ok( "//$userid:$password@/api/v1/holds/0" . "/lowest_priority" )->status_is(404); |
1544 |
$t->put_ok( "//$userid:$password@/api/v1/holds/0" . "/lowest_priority" => json => Mojo::JSON->true ) |
|
|
1545 |
->status_is(404); |
1546 |
|
1547 |
$t->put_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/lowest_priority" => json => Mojo::JSON->true ) |
1548 |
->status_is(200); |
1545 |
|
1549 |
|
1546 |
$t->put_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/lowest_priority" )->status_is(200); |
1550 |
is( $hold->discard_changes->lowestPriority, 1, 'The lowest priority is set' ); |
|
|
1551 |
|
1552 |
$t->put_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/lowest_priority" => json => Mojo::JSON->false ) |
1553 |
->status_is(200); |
1547 |
|
1554 |
|
1548 |
is( $hold->discard_changes->lowestPriority, 1, 'Priority set to lowest' ); |
1555 |
is( $hold->discard_changes->lowestPriority, 0, 'The lowest priority removed' ); |
1549 |
|
1556 |
|
1550 |
$schema->storage->txn_rollback; |
1557 |
$schema->storage->txn_rollback; |
1551 |
}; |
1558 |
}; |
1552 |
- |
|
|