Bugzilla – Attachment 114984 Details for
Bug 27352
Add GET /biblios/:biblio_id/items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27352: Unit tests
Bug-27352-Unit-tests.patch (text/plain), 2.08 KB, created by
Lucas Gass (lukeg)
on 2021-01-08 23:41:18 UTC
(
hide
)
Description:
Bug 27352: Unit tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-01-08 23:41:18 UTC
Size:
2.08 KB
patch
obsolete
>From 5395ac15ee4d80219efd367eb196e4b0b1d6de71 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 6 Jan 2021 13:10:12 -0300 >Subject: [PATCH] Bug 27352: Unit tests > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > t/db_dependent/api/v1/biblios.t | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t >index 66d423d25f..fa75ff4dd4 100755 >--- a/t/db_dependent/api/v1/biblios.t >+++ b/t/db_dependent/api/v1/biblios.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > use Test::Mojo; > use Test::Warn; >@@ -103,6 +103,43 @@ subtest 'get() tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'get_items() tests' => sub { >+ >+ plan tests => 8; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { flags => 0 } >+ } >+ ); >+ my $password = 'thePassword123'; >+ $patron->set_password( { password => $password, skip_validation => 1 } ); >+ $patron->discard_changes; >+ my $userid = $patron->userid; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ $t->get_ok("//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber . "/items") >+ ->status_is(403); >+ >+ $patron->flags(4)->store; >+ >+ $t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber . "/items") >+ ->status_is(200) >+ ->json_is( '' => [], 'No items on the biblio' ); >+ >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber . "/items") >+ ->status_is(200) >+ ->json_is( '' => [ $item_1->to_api, $item_2->to_api ], 'The items are returned' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'delete() tests' => sub { > > plan tests => 9; >-- >2.11.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 27352
:
114892
|
114894
|
114895
|
114983
|
114984
|
114985
|
115810
|
115811
|
115812