From 27a7238d3fe8848de8123fc28fe3ce3df31b2811 Mon Sep 17 00:00:00 2001 From: mpostma Date: Fri, 19 Feb 2021 19:46:45 +0100 Subject: [PATCH] test list no documents --- tests/documents/get_documents.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/documents/get_documents.rs b/tests/documents/get_documents.rs index 40748b555..069d5fd90 100644 --- a/tests/documents/get_documents.rs +++ b/tests/documents/get_documents.rs @@ -22,3 +22,15 @@ async fn get_unexisting_index_all_documents() { .await; assert_eq!(code, 400); } + +#[actix_rt::test] +async fn get_no_documents() { + let server = Server::new().await; + let index = server.index("test"); + let (_, code) = index.create(None).await; + assert_eq!(code, 200); + + let (response, code) = index.get_all_documents(GetAllDocumentsOptions::default()).await; + assert_eq!(code, 200); + assert!(response.as_array().unwrap().is_empty()); +}