Bugzilla – Attachment 168567 Details for
Bug 37261
api/v1/extended_attribute_types does not return additional fields for unmapped tablenames
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37261: Add tests for returning unmapped tablename
Bug-37261-Add-tests-for-returning-unmapped-tablena.patch (text/plain), 2.02 KB, created by
David Nind
on 2024-07-05 21:59:40 UTC
(
hide
)
Description:
Bug 37261: Add tests for returning unmapped tablename
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-07-05 21:59:40 UTC
Size:
2.02 KB
patch
obsolete
>From 022d1e9159b9e08e379b53bf4560f4ec6c9553fc Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 5 Jul 2024 12:04:17 +0000 >Subject: [PATCH] Bug 37261: Add tests for returning unmapped tablename > >Test plan: >1) Apply this patch only, run tests: >prove t/db_dependent/api/v1/extended_attribute_types.t >2) Notice they fail >3) Apply the fix patch, run tests again > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../api/v1/extended_attribute_types.t | 20 ++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/extended_attribute_types.t b/t/db_dependent/api/v1/extended_attribute_types.t >index 38e62ffd6f..2b1ccf4208 100755 >--- a/t/db_dependent/api/v1/extended_attribute_types.t >+++ b/t/db_dependent/api/v1/extended_attribute_types.t >@@ -34,7 +34,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); > > subtest 'list() tests' => sub { > >- plan tests => 17; >+ plan tests => 20; > > $schema->storage->txn_begin; > >@@ -98,6 +98,24 @@ subtest 'list() tests' => sub { > ] > ); > >+ my $additional_field_yet_another_different_tablename = $builder->build_object( >+ { >+ class => 'Koha::AdditionalFields', >+ value => { tablename => 'subscription', name => 'fourth_af_name' }, >+ } >+ ); >+ >+ # Four additional fields created, they should both be returned >+ $t->get_ok("//$userid:$password@/api/v1/extended_attribute_types") >+ ->status_is(200)->json_is( >+ [ >+ $additional_field->to_api, >+ $another_additional_field->to_api, >+ $additional_field_different_tablename->to_api, >+ $additional_field_yet_another_different_tablename->to_api, >+ ] >+ ); >+ > # Filtering works, two existing additional fields returned for the queried table name > $t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?resource_type=invoice")->status_is(200) > ->json_is( [ $additional_field->to_api, $another_additional_field->to_api ] ); >-- >2.39.2
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 37261
:
168531
|
168532
|
168567
|
168568
|
168669
|
168670