Bugzilla – Attachment 98031 Details for
Bug 24487
build_query_params helper builds path parameter with matching criteria
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24487: Add 2 more tests
Bug-24487-Add-2-more-tests.patch (text/plain), 2.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-28 13:56:47 UTC
(
hide
)
Description:
Bug 24487: Add 2 more tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-28 13:56:47 UTC
Size:
2.13 KB
patch
obsolete
>From 89ea311aa68e7d5858d89945e4fd92da789ac77d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Jan 2020 10:47:17 +0100 >Subject: [PATCH] Bug 24487: Add 2 more tests > >And make sure tests pass if there is no patron with borrowernumber=10 in >DB. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Ammended test description >--- > t/db_dependent/Koha/REST/Plugin/Objects.t | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/REST/Plugin/Objects.t b/t/db_dependent/Koha/REST/Plugin/Objects.t >index a25eb21830..9785d7e3f0 100644 >--- a/t/db_dependent/Koha/REST/Plugin/Objects.t >+++ b/t/db_dependent/Koha/REST/Plugin/Objects.t >@@ -189,13 +189,22 @@ subtest 'objects.search helper, embed' => sub { > }; > > subtest 'objects.search helper, with path parameters and _match' => sub { >- plan tests => 4; >+ plan tests => 8; > > $schema->storage->txn_begin; > > Koha::Holds->search()->delete; > >- $builder->build_object({class=>"Koha::Holds", value => {borrowernumber => 10 }}); >+ my $patron = Koha::Patrons->find(10); >+ $patron->delete if $patron; >+ $patron = $builder->build_object( { class => "Koha::Patrons" } ); >+ $patron->borrowernumber(10)->store; >+ $builder->build_object( >+ { >+ class => "Koha::Holds", >+ value => { borrowernumber => $patron->borrowernumber } >+ } >+ ); > > $t->get_ok('/patrons/1/holds?_match=exact') > ->json_is('/count' => 0, 'there should be no holds for borrower 1 with _match=exact'); >@@ -203,5 +212,11 @@ subtest 'objects.search helper, with path parameters and _match' => sub { > $t->get_ok('/patrons/1/holds?_match=contains') > ->json_is('/count' => 0, 'there should be no holds for borrower 1 with _match=contains'); > >+ $t->get_ok('/patrons/10/holds?_match=exact') >+ ->json_is('/count' => 1, 'there should be 1 hold for borrower 10 with _match=exact'); >+ >+ $t->get_ok('/patrons/10/holds?_match=contains') >+ ->json_is('/count' => 1, 'there should be 1 hold for borrower 10 with _match=contains'); >+ > $schema->storage->txn_rollback; > }; >-- >2.25.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 24487
:
97765
|
97772
|
97774
|
97775
|
97782
|
98029
|
98030
|
98031
|
98164
|
98165
|
98166
|
103105
|
103106
|
103107
|
103142
|
103143
|
103144