Bugzilla – Attachment 61952 Details for
Bug 18374
Respect QueryAutoTruncate syspref in Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18374 - QueryAutoTruncate unit tests
Bug-18374---QueryAutoTruncate-unit-tests.patch (text/plain), 1.62 KB, created by
Nick Clemens (kidclamp)
on 2017-04-06 18:55:28 UTC
(
hide
)
Description:
Bug 18374 - QueryAutoTruncate unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-04-06 18:55:28 UTC
Size:
1.62 KB
patch
obsolete
>From 21bd2e3797e84bfc4472b4dc1e58e304ee09847b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 6 Apr 2017 14:27:50 -0400 >Subject: [PATCH] Bug 18374 - QueryAutoTruncate unit tests > >To test: >1 - Apply just this patch - should fail >2 - Apply the second patch - should pass > >https://bugs.koha-community.org/show_bug.cgi?id=18347 >--- > t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >index f83bd8d..b8dcc6f 100644 >--- a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >+++ b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >@@ -81,7 +81,7 @@ subtest 'json2marc' => sub { > }; > > subtest 'build_query tests' => sub { >- plan tests => 6; >+ plan tests => 8; > > t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); > my $query = $builder->build_query(); >@@ -101,6 +101,15 @@ subtest 'build_query tests' => sub { > 'homebranch added to facets if DisplayLibraryFacets=home' ); > ok( !defined $query->{aggregations}{holdingbranch}, > 'holdingbranch not added to facets if DisplayLibraryFacets=home' ); >+ >+ t::lib::Mocks::mock_preference('QueryAutoTruncate',''); >+ $query = $builder->build_query('donald duck'); >+ is( $query->{query}{query_string}{query}, "donald duck" ); >+ >+ t::lib::Mocks::mock_preference('QueryAutoTruncate','1'); >+ $query = $builder->build_query('donald duck'); >+ is( $query->{query}{query_string}{query}, "donald* duck*" ); >+ > }; > > 1; >-- >2.1.4
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 18374
:
61806
|
61952
|
61953
|
61954
|
61955
|
61983
|
64903
|
64904
|
67098
|
67099
|
67100
|
67467
|
67468
|
67469
|
67470
|
67727
|
68062
|
68063
|
68064
|
68065
|
68066
|
68067
|
68068