Bugzilla – Attachment 168663 Details for
Bug 37289
t/db_dependent/api/v1/authorised_values.t is failing under specific circumstances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37289: Add sorting to test
Bug-37289-Add-sorting-to-test.patch (text/plain), 2.86 KB, created by
Jonathan Druart
on 2024-07-09 14:23:34 UTC
(
hide
)
Description:
Bug 37289: Add sorting to test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-07-09 14:23:34 UTC
Size:
2.86 KB
patch
obsolete
>From a4c63317aff64206732b6e34dbecaa987cf3e741 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 9 Jul 2024 13:23:50 +0000 >Subject: [PATCH] Bug 37289: Add sorting to test > >Ensure the order of embedded records returned. >Dont apply the DONT PUSH patch. >prove ./t/db_dependent/api/v1/authorised_values.t ---> Notice if passes > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/api/v1/authorised_values.t | 38 ++++++++++++++++++++--- > 1 file changed, 34 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/api/v1/authorised_values.t b/t/db_dependent/api/v1/authorised_values.t >index 067701e1be4..1a322112f4d 100755 >--- a/t/db_dependent/api/v1/authorised_values.t >+++ b/t/db_dependent/api/v1/authorised_values.t >@@ -104,18 +104,48 @@ subtest 'list_av_from_category() tests' => sub { > > # Test the query webservice endpoint for multiple av_cats with authorised_values embedded > my $av_2 = $builder->build_object( >- { class => 'Koha::AuthorisedValues', value => { category => $av_cat_2->category_name, lib => undef } } ); >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { >+ category => $av_cat_2->category_name, >+ authorised_value => 'a', >+ lib => undef >+ } >+ } >+ ); > my $av_3 = $builder->build_object( > { > class => 'Koha::AuthorisedValues', >- value => { category => $av_cat_2->category_name, lib => 'description_value' } >+ value => { >+ category => $av_cat_2->category_name, >+ authorised_value => 'c', >+ lib => 'description_value' >+ } >+ } >+ ); >+ my $av_4 = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { >+ category => $av_cat_2->category_name, >+ authorised_value => 'b', >+ lib => 'description_value' >+ } > } > ); > > my $embedded_av_query = { "me.category_name" => [ $av_cat_2->category_name ] }; >- $t->get_ok( "//$userid:$password@/api/v1/authorised_value_categories?q=" >+ $t->get_ok( "//$userid:$password@/api/v1/authorised_value_categories?_order_by=authorised_values.authorised_value&q=" > . encode_json($embedded_av_query) => { 'x-koha-embed' => 'authorised_values' } )->status_is(200) >- ->json_is( [ { %{ $av_cat_2->to_api }, authorised_values => [ $av_2->to_api, $av_3->to_api ] } ] ); >+ ->json_is( >+ [ >+ { >+ %{ $av_cat_2->to_api }, >+ authorised_values => >+ [ $av_2->to_api, $av_4->to_api, $av_3->to_api ] >+ } >+ ] >+ ); > > $schema->storage->txn_rollback; > }; >-- >2.34.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 37289
:
168647
|
168648
| 168663