Bugzilla – Attachment 143356 Details for
Bug 26635
Expand coded values in REST API call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26635: Add tests for av-expand => 0
Bug-26635-Add-tests-for-av-expand--0.patch (text/plain), 2.95 KB, created by
Martin Renvoize (ashimema)
on 2022-11-07 12:29:48 UTC
(
hide
)
Description:
Bug 26635: Add tests for av-expand => 0
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-07 12:29:48 UTC
Size:
2.95 KB
patch
obsolete
>From 906c046a5b93c3935f1cd60b20ffda5ef25edb3c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 31 Aug 2021 10:03:46 +0200 >Subject: [PATCH] Bug 26635: Add tests for av-expand => 0 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/REST/Plugin/Objects.t | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/REST/Plugin/Objects.t b/t/db_dependent/Koha/REST/Plugin/Objects.t >index 60163ee010..509d98975b 100755 >--- a/t/db_dependent/Koha/REST/Plugin/Objects.t >+++ b/t/db_dependent/Koha/REST/Plugin/Objects.t >@@ -621,7 +621,7 @@ subtest 'objects.search helper, search_limited() tests' => sub { > }; > > subtest 'objects.find helper with expanded authorised values' => sub { >- plan tests => 10; >+ plan tests => 14; > > $schema->storage->txn_begin; > >@@ -708,6 +708,10 @@ subtest 'objects.find helper with expanded authorised values' => sub { > ->json_has('/_authorised_values') > ->json_is( '/_authorised_values/country/lib' => $ar->lib ); > >+ $t->get_ok( '/cities/' . $manuel->cityid => { 'x-koha-av-expand' => 0 } ) >+ ->status_is(200)->json_is( '/name' => 'Manuel' ) >+ ->json_hasnt('/_authorised_values'); >+ > $t->get_ok( '/cities/' . $manuela->cityid => { 'x-koha-av-expand' => 1 } ) > ->status_is(200)->json_is( '/name' => 'Manuela' ) > ->json_has('/_authorised_values') >@@ -718,7 +722,7 @@ subtest 'objects.find helper with expanded authorised values' => sub { > > subtest 'objects.search helper with expanded authorised values' => sub { > >- plan tests => 11; >+ plan tests => 20; > > my $t = Test::Mojo->new; > >@@ -801,12 +805,21 @@ subtest 'objects.search helper with expanded authorised values' => sub { > ); > > $t->get_ok( '/cities?name=manuel&_per_page=4&_page=1&_match=starts_with' => >- { 'x-koha-av-expand' => 1 } )->status_is(200)->json_has('/0') >- ->json_has('/1')->json_hasnt('/2')->json_is( '/0/name' => 'Manuel' ) >+ { 'x-koha-av-expand' => 1 } )->status_is(200) >+ ->json_has('/0')->json_has('/1')->json_hasnt('/2') >+ ->json_is( '/0/name' => 'Manuel' ) > ->json_has('/0/_authorised_values') > ->json_is( '/0/_authorised_values/country/lib' => $ar->lib ) >- ->json_is( '/1/name' => 'Manuela' )->json_has('/1/_authorised_values') >+ ->json_is( '/1/name' => 'Manuela' ) >+ ->json_has('/1/_authorised_values') > ->json_is( '/1/_authorised_values/country/lib' => $us->lib ); > >+ $t->get_ok( '/cities?name=manuel&_per_page=4&_page=1&_match=starts_with' => >+ { 'x-koha-av-expand' => 0 } )->status_is(200) >+ ->json_has('/0')->json_has('/1')->json_hasnt('/2') >+ ->json_is( '/0/name' => 'Manuel' )->json_hasnt('/0/_authorised_values') >+ ->json_is( '/1/name' => 'Manuela' )->json_hasnt('/1/_authorised_values'); >+ >+ > $schema->storage->txn_rollback; > }; >-- >2.20.1
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 26635
:
111400
|
111401
|
111402
|
111411
|
111412
|
111413
|
111414
|
112538
|
112539
|
116232
|
116233
|
116234
|
116235
|
116592
|
116593
|
120698
|
120699
|
120700
|
124268
|
142761
|
142762
|
142763
|
142776
|
142792
|
142793
|
142794
|
142795
|
142796
|
142801
|
142802
|
142803
|
142804
|
142805
|
143039
|
143040
|
143041
|
143042
|
143043
|
143044
|
143073
|
143074
|
143075
|
143076
|
143077
|
143078
|
143079
|
143080
|
143127
|
143128
|
143129
|
143130
|
143131
|
143132
|
143133
|
143134
|
143276
|
143354
|
143355
| 143356 |
143357
|
143358
|
143359
|
143360
|
143361
|
143362