From 84b4219a4fa153c83a31f00fc45b7545d66cf0a6 Mon Sep 17 00:00:00 2001 From: Timon Jurschitsch Date: Sun, 29 Sep 2024 10:16:31 +0200 Subject: [PATCH] test: improve delete_index.rs --- meilisearch/tests/index/delete_index.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meilisearch/tests/index/delete_index.rs b/meilisearch/tests/index/delete_index.rs index e404a6003..8e238dad3 100644 --- a/meilisearch/tests/index/delete_index.rs +++ b/meilisearch/tests/index/delete_index.rs @@ -5,19 +5,19 @@ use crate::json; async fn create_and_delete_index() { let server = Server::new().await; let index = server.index("test"); - let (_response, code) = index.create(None).await; + let (response, code) = index.create(None).await; assert_eq!(code, 202); - index.wait_task(0).await; + index.wait_task(response.uid()).await.succeeded(); assert_eq!(index.get().await.1, 200); - let (_response, code) = index.delete().await; + let (response, code) = index.delete().await; assert_eq!(code, 202); - index.wait_task(1).await; + index.wait_task(response.uid()).await.succeeded(); assert_eq!(index.get().await.1, 404); } @@ -26,7 +26,7 @@ async fn create_and_delete_index() { async fn error_delete_unexisting_index() { let server = Server::new().await; let index = server.index("test"); - let (_, code) = index.delete().await; + let (task, code) = index.delete().await; assert_eq!(code, 202); @@ -37,7 +37,7 @@ async fn error_delete_unexisting_index() { "link": "https://docs.meilisearch.com/errors#index_not_found" }); - let response = index.wait_task(0).await; + let response = index.wait_task(task.uid()).await; assert_eq!(response["status"], "failed"); assert_eq!(response["error"], expected_response); }