Bugzilla – Attachment 125173 Details for
Bug 27947
Add default cancellation reasons to article requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27947: (QA follow-up) Update test to highlight issue
Bug-27947-QA-follow-up-Update-test-to-highlight-is.patch (text/plain), 3.46 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-09-22 19:37:01 UTC
(
hide
)
Description:
Bug 27947: (QA follow-up) Update test to highlight issue
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-09-22 19:37:01 UTC
Size:
3.46 KB
patch
obsolete
>From 83b3ae035e0e3400d3b51a5a09296efe75660a02 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 17 Sep 2021 17:09:58 +0100 >Subject: [PATCH] Bug 27947: (QA follow-up) Update test to highlight issue > >This addition to the tests highlights a permissions/security check >error. >--- > t/db_dependent/api/v1/article_requests.t | 31 ++++++++++++++++-------- > 1 file changed, 21 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/api/v1/article_requests.t b/t/db_dependent/api/v1/article_requests.t >index 5f9ae1cd4e..9518f42737 100755 >--- a/t/db_dependent/api/v1/article_requests.t >+++ b/t/db_dependent/api/v1/article_requests.t >@@ -48,13 +48,13 @@ subtest 'cancel() tests' => sub { > { password => $password, skip_validation => 1 } ); > my $userid = $authorized_patron->userid; > >- my $deleted_article_requet = >+ my $deleted_article_request = > $builder->build_object( { class => 'Koha::ArticleRequests' } ); >- my $deleted_article_requet_id = $deleted_article_requet->id; >- $deleted_article_requet->delete; >+ my $deleted_article_request_id = $deleted_article_request->id; >+ $deleted_article_request->delete; > > $t->delete_ok( >-"//$userid:$password@/api/v1/article_requests/$deleted_article_requet_id" >+"//$userid:$password@/api/v1/article_requests/$deleted_article_request_id" > )->status_is(404)->json_is( { error => "Article request not found" } ); > > my $article_request = >@@ -80,7 +80,7 @@ subtest 'cancel() tests' => sub { > > subtest 'patron_cancel() tests' => sub { > >- plan tests => 10; >+ plan tests => 12; > > t::lib::Mocks::mock_preference( 'RESTPublicAPI', 1 ); > t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); >@@ -98,20 +98,31 @@ subtest 'patron_cancel() tests' => sub { > my $userid = $patron->userid; > my $patron_id = $patron->borrowernumber; > >- my $deleted_article_requet = $builder->build_object( { class => 'Koha::ArticleRequests' } ); >- my $deleted_article_requet_id = $deleted_article_requet->id; >- $deleted_article_requet->delete; >+ my $deleted_article_request = $builder->build_object( { class => 'Koha::ArticleRequests', value => { borrowernumber => $patron_id } } ); >+ my $deleted_article_request_id = $deleted_article_request->id; >+ $deleted_article_request->delete; > > my $another_patron = $builder->build_object({ class => 'Koha::Patrons' }); > my $another_patron_id = $another_patron->id; > >- $t->delete_ok("//$userid:$password@/api/v1/public/patrons/$another_patron_id/article_requests/$deleted_article_requet_id") >+ $t->delete_ok("//$userid:$password@/api/v1/public/patrons/$another_patron_id/article_requests/$deleted_article_request_id") > ->status_is(403); > >- $t->delete_ok("//$userid:$password@/api/v1/public/patrons/$patron_id/article_requests/$deleted_article_requet_id") >+ $t->delete_ok("//$userid:$password@/api/v1/public/patrons/$patron_id/article_requests/$deleted_article_request_id") > ->status_is(404) > ->json_is( { error => "Article request not found" } ); > >+ my $another_article_request = $builder->build_object( >+ { >+ class => 'Koha::ArticleRequests', >+ value => { borrowernumber => $another_patron->id } >+ } >+ ); >+ >+ $t->delete_ok("//$userid:$password@/api/v1/public/patrons/$patron_id/article_requests/$another_article_request") >+ ->status_is(403); >+ >+ > my $article_request = $builder->build_object( > { > class => 'Koha::ArticleRequests', >-- >2.30.2
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 27947
:
124063
|
124064
|
124065
|
124849
|
124850
|
124851
|
124952
|
124953
|
124954
|
124955
|
124956
|
124993
|
124994
|
124995
|
124996
|
124997
|
124998
|
124999
|
125002
|
125003
|
125004
|
125005
|
125006
|
125007
|
125008
|
125009
|
125010
|
125016
|
125038
|
125039
|
125040
|
125041
|
125042
|
125043
|
125044
|
125045
|
125046
|
125047
|
125165
|
125166
|
125167
|
125168
|
125169
|
125170
|
125171
|
125172
| 125173 |
125174
|
125739
|
125740