Bugzilla – Attachment 114778 Details for
Bug 23857
Club holds endpoint not setting Location header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23857: Regression tests
Bug-23857-Regression-tests.patch (text/plain), 2.91 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-01-04 13:01:25 UTC
(
hide
)
Description:
Bug 23857: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-01-04 13:01:25 UTC
Size:
2.91 KB
patch
obsolete
>From 55d4edd1bef1cedeb397477ee32ef43a01988381 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 4 Jan 2021 09:59:26 -0300 >Subject: [PATCH] Bug 23857: Regression tests > >--- > t/db_dependent/api/v1/clubs_holds.t | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/api/v1/clubs_holds.t b/t/db_dependent/api/v1/clubs_holds.t >index 240018f65f..46c5402df5 100755 >--- a/t/db_dependent/api/v1/clubs_holds.t >+++ b/t/db_dependent/api/v1/clubs_holds.t >@@ -58,11 +58,12 @@ subtest 'add() tests' => sub { > $schema->storage->txn_rollback; > > subtest 'librarian access tests' => sub { >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > > my ($club_with_enrollments, $club_without_enrollments, $item, @enrollments) = create_test_data(); >+ my $club_with_enrollments_id = $club_with_enrollments->id; > > my ( undef, $session_id ) = create_user_and_session({ authorized => 1 }); > my $data = { >@@ -81,18 +82,23 @@ subtest 'add() tests' => sub { > ->status_is(201, 'Created Hold') > ->json_has('/club_hold_id', 'got a club hold id') > ->json_is( '/club_id' => $club_with_enrollments->id) >- ->json_is( '/biblio_id' => $item->biblionumber); >+ ->json_is( '/biblio_id' => $item->biblionumber) >+ ->header_like( >+ Location => qr|^\/api\/v1\/clubs/$club_with_enrollments_id/holds|, >+ 'SWAGGER3.4.1' >+ ); > > $schema->storage->txn_rollback; > }; > }; > > subtest "default patron home" => sub { >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > > my ($club_with_enrollments, $club_without_enrollments, $item, @enrollments) = create_test_data(); >+ my $club_with_enrollments_id = $club_with_enrollments->id; > > my ( undef, $session_id ) = create_user_and_session({ authorized => 1 }); > my $data = { >@@ -104,7 +110,11 @@ subtest "default patron home" => sub { > my $tx = $t->ua->build_tx(POST => "/api/v1/clubs/".$club_with_enrollments->id."/holds" => json => $data); > $tx->req->cookies({ name => 'CGISESSID', value => $session_id }); > $t->request_ok($tx) >- ->status_is(201, 'Created Hold'); >+ ->status_is(201, 'Created Hold') >+ ->header_like( >+ Location => qr|^\/api\/v1\/clubs/$club_with_enrollments_id/holds|, >+ 'SWAGGER3.4.1' >+ ); > > my $json_response = decode_json $t->tx->res->content->get_body_chunk; > >@@ -197,4 +207,4 @@ sub create_test_data { > $lib = $builder->build_object({ class => 'Koha::Libraries', value => {pickup_location => 1}}); > my $item = $builder->build_sample_item({homebranch => $lib->branchcode}); > return ( $club_with_enrollments, $club_without_enrollments, $item, [ $enrollment1, $enrollment2, $enrollment3, $enrollment4, $enrollment5, $enrollment6 ] ); >-} >\ No newline at end of file >+} >-- >2.30.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 23857
:
114778
|
114779
|
114782
|
114783
|
114784
|
115789
|
115790
|
115791