Bugzilla – Attachment 154105 Details for
Bug 34024
REST API should not allow changing the pickup location on found holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34024: Unit tests
Bug-34024-Unit-tests.patch (text/plain), 3.18 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-07-31 17:50:46 UTC
(
hide
)
Description:
Bug 34024: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-07-31 17:50:46 UTC
Size:
3.18 KB
patch
obsolete
>From cad95e5feab789ebfcd7806187359f7e4f0412ca Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 31 Jul 2023 14:00:36 -0300 >Subject: [PATCH] Bug 34024: Unit tests > >--- > api/v1/swagger/paths/holds.yaml | 14 ++++++++++---- > t/db_dependent/api/v1/holds.t | 21 ++++++++++++++++++++- > 2 files changed, 30 insertions(+), 5 deletions(-) > >diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml >index 528656748b4..fefdddc0982 100644 >--- a/api/v1/swagger/paths/holds.yaml >+++ b/api/v1/swagger/paths/holds.yaml >@@ -680,13 +680,19 @@ > schema: > $ref: "../swagger.yaml#/definitions/error" > "409": >- description: Unable to perform action on hold >+ description: | >+ Unable to perform action on hold. Possible `error_code` attribute values: >+ >+ * `hold_waiting` >+ * `hold_in_transit` >+ * `hold_in_processing` > schema: > $ref: "../swagger.yaml#/definitions/error" > "500": >- description: Internal error >- schema: >- $ref: "../swagger.yaml#/definitions/error" >+ description: | >+ Internal server error. Possible `error_code` attribute values: >+ >+ * `internal_server_error` > "503": > description: Under maintenance > schema: >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index adc54296605..bf58edc7535 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -1270,7 +1270,7 @@ subtest 'add() tests' => sub { > > subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { > >- plan tests => 28; >+ plan tests => 37; > > $schema->storage->txn_begin; > >@@ -1403,6 +1403,25 @@ subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { > > is( $hold->discard_changes->branchcode->branchcode, $library_2->branchcode, 'invalid pickup library not used, even if x-koha-override is passed' ); > >+ my $waiting_hold = $builder->build_object( { class => 'Koha::Holds', value => { found => 'W' } } ); >+ my $in_processing_hold = $builder->build_object( { class => 'Koha::Holds', value => { found => 'P' } } ); >+ my $in_transit_hold = $builder->build_object( { class => 'Koha::Holds', value => { found => 'T' } } ); >+ >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" >+ . $waiting_hold->id >+ . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409) >+ ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_waiting' } ); >+ >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" >+ . $in_processing_hold->id >+ . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409) >+ ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_in_processing' } ); >+ >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" >+ . $in_transit_hold->id >+ . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409) >+ ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_in_transit' } ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.41.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34024
:
154105
|
154106
|
154126
|
154127
|
154132
|
154513
|
154514
|
154515