Bugzilla – Attachment 61993 Details for
Bug 18407
REST API: Include renewability information on checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18407: (follow-up) Add test for librarian access
Bug-18407-follow-up-Add-test-for-librarian-access.patch (text/plain), 2.08 KB, created by
Lari Taskula
on 2017-04-10 11:05:29 UTC
(
hide
)
Description:
Bug 18407: (follow-up) Add test for librarian access
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-04-10 11:05:29 UTC
Size:
2.08 KB
patch
obsolete
>From 36f0dd30c372466872f9073065bc43458a219a0f Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Mon, 10 Apr 2017 11:04:18 +0000 >Subject: [PATCH] Bug 18407: (follow-up) Add test for librarian access > >--- > t/db_dependent/api/v1/checkoutsexpanded.t | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/checkoutsexpanded.t b/t/db_dependent/api/v1/checkoutsexpanded.t >index 9686d26..ccd6451 100644 >--- a/t/db_dependent/api/v1/checkoutsexpanded.t >+++ b/t/db_dependent/api/v1/checkoutsexpanded.t >@@ -47,7 +47,7 @@ my $module = new Test::MockModule('C4::Context'); > $module->mock('userenv', sub { { branch => $branchcode } }); > > subtest 'get() tests' => sub { >- plan tests => 17; >+ plan tests => 34; > > $schema->storage->txn_begin; > >@@ -117,6 +117,28 @@ subtest 'get() tests' => sub { > ->json_is('/1/max_renewals' => 1) > ->json_hasnt('/2'); > >+ t::lib::Mocks::mock_preference('OpacRenewalAllowed', 0); >+ $tx = $t->ua->build_tx(GET => "/api/v1/checkouts/expanded?borrowernumber=" >+ .$borrowernumber); >+ $tx->req->cookies({name =>'CGISESSID', value => $librariansessionid}); >+ $tx->req->env({REMOTE_ADDR => '127.0.0.1'}); >+ $t->request_ok($tx) >+ ->status_is(200) >+ ->json_is('/0/borrowernumber' => $borrowernumber) >+ ->json_is('/0/itemnumber' => $itemnumber1) >+ ->json_like('/0/date_due' => qr/$due\+\d\d:\d\d/) >+ ->json_is('/0/renewals' => 0) >+ ->json_is('/0/renewable' => Mojo::JSON->true) >+ ->json_is('/0/renewability_error' => undef) >+ ->json_is('/0/max_renewals' => 5) >+ ->json_is('/1/borrowernumber' => $borrowernumber) >+ ->json_is('/1/itemnumber' => $itemnumber2) >+ ->json_like('/1/date_due' => qr/$due2\+\d\d:\d\d/) >+ ->json_is('/1/renewals' => 1) >+ ->json_is('/1/renewable' => Mojo::JSON->false) >+ ->json_is('/1/renewability_error' => 'too_many') >+ ->json_is('/1/max_renewals' => 1) >+ ->json_hasnt('/2'); > $schema->storage->txn_rollback; > }; > >-- >2.7.4
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 18407
:
61991
|
61992
| 61993 |
65009