Bugzilla – Attachment 97424 Details for
Bug 24432
order_by broken for date columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24432: Regresion test
Bug-24432-Regresion-test.patch (text/plain), 2.11 KB, created by
Agustín Moyano
on 2020-01-15 23:18:35 UTC
(
hide
)
Description:
Bug 24432: Regresion test
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2020-01-15 23:18:35 UTC
Size:
2.11 KB
patch
obsolete
>From f39cb7c20b05aaaeeecec8aa1dd8a285d9b65f08 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Wed, 15 Jan 2020 19:52:53 -0300 >Subject: [PATCH] Bug 24432: Regresion test > >To test: >1. apply this patch >2. prove t/Koha/REST/Plugin/Query.t > >Test should fail at this point. >--- > t/Koha/REST/Plugin/Query.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/REST/Plugin/Query.t b/t/Koha/REST/Plugin/Query.t >index 7bf7c3cca3..fa69b55848 100644 >--- a/t/Koha/REST/Plugin/Query.t >+++ b/t/Koha/REST/Plugin/Query.t >@@ -22,6 +22,7 @@ use Mojolicious::Lite; > use Try::Tiny; > > use Koha::Cities; >+use Koha::Holds; > > app->log->level('error'); > >@@ -108,6 +109,20 @@ get '/dbic_merge_sorting_result_set' => sub { > $c->render( json => $attributes, status => 200 ); > }; > >+get '/dbic_merge_sorting_date' => sub { >+ my $c = shift; >+ my $attributes = { a => 'a', b => 'b' }; >+ my $result_set = Koha::Holds->new; >+ $attributes = $c->dbic_merge_sorting( >+ { >+ attributes => $attributes, >+ params => { _match => 'exact', _order_by => [ '-hold_date' ] }, >+ result_set => $result_set >+ } >+ ); >+ $c->render( json => $attributes, status => 200 ); >+}; >+ > get '/build_query' => sub { > my $c = shift; > my ( $filtered_params, $reserved_params ) = >@@ -214,7 +229,7 @@ subtest 'extract_reserved_params() tests' => sub { > > subtest 'dbic_merge_sorting() tests' => sub { > >- plan tests => 15; >+ plan tests => 20; > > my $t = Test::Mojo->new; > >@@ -240,6 +255,14 @@ subtest 'dbic_merge_sorting() tests' => sub { > ] > ); > >+ $t->get_ok('/dbic_merge_sorting_date')->status_is(200) >+ ->json_is( '/a' => 'a', 'Existing values are kept (a)' ) >+ ->json_is( '/b' => 'b', 'Existing values are kept (b)' )->json_is( >+ '/order_by' => [ >+ { -desc => 'reservedate' } >+ ] >+ ); >+ > $t->get_ok('/dbic_merge_sorting_single')->status_is(200) > ->json_is( '/a' => 'a', 'Existing values are kept (a)' ) > ->json_is( '/b' => 'b', 'Existing values are kept (b)' )->json_is( >-- >2.17.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 24432
:
97421
|
97424
|
97425
|
97426
|
97528
|
97529
|
97530
|
97660
|
97661
|
97662