Bugzilla – Attachment 69383 Details for
Bug 19370
Add a helper function for translating order_by params into SQL::Abstract
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19370: (QA followup) Use OpenAPI's handling of pipe separated values
Bug-19370-QA-followup-Use-OpenAPIs-handling-of-pip.patch (text/plain), 2.46 KB, created by
Tomás Cohen Arazi
on 2017-11-27 14:38:16 UTC
(
hide
)
Description:
Bug 19370: (QA followup) Use OpenAPI's handling of pipe separated values
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2017-11-27 14:38:16 UTC
Size:
2.46 KB
patch
obsolete
>From 2eaf7b8fc3f339379ff9b5386a123c60d466a73c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 27 Nov 2017 11:37:18 -0300 >Subject: [PATCH] Bug 19370: (QA followup) Use OpenAPI's handling of pipe > separated values > >This patch makes the helper handling _order_by params expect a list of >values instead of a (to-be-splitted) string. > >The idea is that the OpenAPI plugin will take care of splitting >pipe-delimited values if the spec is correctly defined. > >Note: In the process I noticed + on the URL represents a space, so the >helper function is updated to handle both + and %2B as ascending. > >To test: >- Run: > $ kshell > k$ prove t/Koha/REST/Plugin/Query.t >=> SUCCESS: Tests pass! >- Sign off :-D > >Edit: Removed rebasing leftover making the tests fail. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/Koha/REST/Plugin/Query.t | 37 ------------------------------------- > 1 file changed, 37 deletions(-) > >diff --git a/t/Koha/REST/Plugin/Query.t b/t/Koha/REST/Plugin/Query.t >index ac126a17ae..7a853d4bff 100644 >--- a/t/Koha/REST/Plugin/Query.t >+++ b/t/Koha/REST/Plugin/Query.t >@@ -128,40 +128,3 @@ subtest 'dbic_merge_sorting() tests' => sub { > ] > ); > }; >- >-subtest '_build_query_params_from_api' => sub { >- >- plan tests => 16; >- >- my $t = Test::Mojo->new; >- >- # _match => contains >- $t->get_ok('/build_query?_match=contains&title=Ender&author=Orson') >- ->status_is(200) >- ->json_is( '/query' => >- { author => { like => '%Orson%' }, title => { like => '%Ender%' } } ); >- >- # _match => starts_with >- $t->get_ok('/build_query?_match=starts_with&title=Ender&author=Orson') >- ->status_is(200) >- ->json_is( '/query' => >- { author => { like => 'Orson%' }, title => { like => 'Ender%' } } ); >- >- # _match => ends_with >- $t->get_ok('/build_query?_match=ends_with&title=Ender&author=Orson') >- ->status_is(200) >- ->json_is( '/query' => >- { author => { like => '%Orson' }, title => { like => '%Ender' } } ); >- >- # _match => exact >- $t->get_ok('/build_query?_match=exact&title=Ender&author=Orson') >- ->status_is(200) >- ->json_is( '/query' => { author => 'Orson', title => 'Ender' } ); >- >- # _match => blah >- $t->get_ok('/build_query?_match=blah&title=Ender&author=Orson') >- ->status_is(400) >- ->json_is( '/exception_msg' => 'Invalid value for _match param (blah)' ) >- ->json_is( '/exception_type' => 'Koha::Exceptions::WrongParameter' ); >- >-}; >-- >2.14.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 19370
:
67379
|
67380
|
67402
|
67403
|
67525
|
67576
|
67782
|
67783
|
67784
|
69304
|
69305
|
69307
|
69383
|
69384
|
69391
|
69392
|
69393
|
69394