From 60a42bc511d555fbae5ff6ffca766e5d0820072f Mon Sep 17 00:00:00 2001 From: mpostma Date: Wed, 24 Feb 2021 10:19:22 +0100 Subject: [PATCH] reset settings --- tests/settings/get_settings.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/settings/get_settings.rs b/tests/settings/get_settings.rs index 44866c0b0..bae044acb 100644 --- a/tests/settings/get_settings.rs +++ b/tests/settings/get_settings.rs @@ -60,6 +60,26 @@ async fn delete_settings_unexisting_index() { assert_eq!(code, 400); } +#[actix_rt::test] +async fn reset_all_settings() { + let server = Server::new().await; + let index = server.index("test"); + index.update_settings(json!({"displayedAttributes": ["foo"], "searchableAttributes": ["bar"]})).await; + index.wait_update_id(0).await; + let (response, code) = index.settings().await; + assert_eq!(code, 200); + assert_eq!(response["displayedAttributes"],json!(["foo"])); + assert_eq!(response["searchableAttributes"],json!(["bar"])); + + index.delete_settings().await; + index.wait_update_id(1).await; + + let (response, code) = index.settings().await; + assert_eq!(code, 200); + assert_eq!(response["displayedAttributes"],json!(["*"])); + assert_eq!(response["searchableAttributes"],json!(["*"])); +} + #[actix_rt::test] async fn update_setting_unexisting_index() { let server = Server::new().await;