Bugzilla – Attachment 173021 Details for
Bug 38204
Add `GET /acquisitions/baskets`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38204: Add unit test
Bug-38204-Add-unit-test.patch (text/plain), 1.98 KB, created by
David Nind
on 2024-10-21 10:17:33 UTC
(
hide
)
Description:
Bug 38204: Add unit test
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-10-21 10:17:33 UTC
Size:
1.98 KB
patch
obsolete
>From 079eed0ee4198fd974f1c8f2713854573c5b68a7 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 17 Oct 2024 13:41:02 +0000 >Subject: [PATCH] Bug 38204: Add unit test > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/api/v1/acquisitions_baskets.t | 39 +++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/acquisitions_baskets.t b/t/db_dependent/api/v1/acquisitions_baskets.t >index dd1edbb342..69222a80b0 100755 >--- a/t/db_dependent/api/v1/acquisitions_baskets.t >+++ b/t/db_dependent/api/v1/acquisitions_baskets.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::Mojo; > > use t::lib::TestBuilder; >@@ -70,3 +70,40 @@ subtest 'list_managers() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'list() tests' => sub { >+ >+ plan tests => 6; >+ >+ $schema->storage->txn_begin; >+ >+ $schema->resultset('Aqbasket')->search->delete; >+ >+ my $superlibrarian = >+ $builder->build_object( { class => 'Koha::Patrons', value => { flags => 1 } } ); >+ my $password = 'thePassword123'; >+ $superlibrarian->set_password( { password => $password, skip_validation => 1 } ); >+ my $userid = $superlibrarian->userid; >+ $superlibrarian->discard_changes; >+ >+ $t->get_ok("//$userid:$password@/api/v1/acquisitions/baskets")->status_is(200)->json_is( >+ [] >+ ); >+ >+ my $vendor = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Booksellers', >+ } >+ ); >+ my $basket = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets', >+ value => { closedate => undef, authorisedby => undef, booksellerid => $vendor->id, branch => undef } >+ } >+ ); >+ >+ $t->get_ok("//$userid:$password@/api/v1/acquisitions/baskets")->status_is(200)->json_is( [$basket->to_api ]); >+ >+ $schema->storage->txn_rollback; >+ >+} >\ No newline at end of file >-- >2.39.5
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 38204
:
172943
|
172944
|
173020
|
173021
|
173259
|
173366
|
173367
|
173368
|
173369