Bug 16325: Add a test for SearchSuggestions when searching for STATUS=''
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 May 2016 15:13:27 +0000 (16:13 +0100)
committerBrendan Gallagher <bredan@bywatersolutions.com>
Thu, 5 May 2016 20:46:01 +0000 (20:46 +0000)
Test fails as expected without second patch and passes OK with second patch.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
t/db_dependent/Suggestions.t

index a960331..79e5cbe 100644 (file)
@@ -28,7 +28,7 @@ use Koha::Library;
 use Koha::Libraries;
 
 use DateTime::Duration;
-use Test::More tests => 105;
+use Test::More tests => 106;
 use Test::Warn;
 
 BEGIN {
@@ -303,6 +303,11 @@ $search_suggestion = SearchSuggestion({
     STATUS => $mod_suggestion3->{STATUS},
 });
 is( @$search_suggestion, 1, 'SearchSuggestion returns the correct number of suggestions' );
+
+$search_suggestion = SearchSuggestion({
+    STATUS => q||
+});
+is( @$search_suggestion, 0, 'SearchSuggestion should not return all suggestions if we want the suggestions with a STATUS=""' );
 $search_suggestion = SearchSuggestion({
     STATUS => 'REJECTED',
 });