From ab170ce4fd25574f49947df7af028f6804fe7697 Mon Sep 17 00:00:00 2001 From: qdequele Date: Mon, 17 Aug 2020 17:42:48 +0200 Subject: [PATCH] add test --- meilisearch-http/tests/placeholder_search.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meilisearch-http/tests/placeholder_search.rs b/meilisearch-http/tests/placeholder_search.rs index 9a63133cf..4d380563f 100644 --- a/meilisearch-http/tests/placeholder_search.rs +++ b/meilisearch-http/tests/placeholder_search.rs @@ -495,3 +495,19 @@ async fn placeholder_test_sort() { }); }); } + +#[actix_rt::test] +async fn placeholder_search_with_empty_query() { + let mut server = common::Server::test_server().await; + + let query = json! ({ + "q": "", + "limit": 3 + }); + + test_post_get_search!(server, query, |response, status_code| { + eprintln!("{}", response); + assert_eq!(status_code, 200); + assert_eq!(response["hits"].as_array().unwrap().len(), 3); + }); +}