reset settings

This commit is contained in:
mpostma 2021-02-24 10:19:22 +01:00
parent 3f939f3ccf
commit 60a42bc511
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
1 changed files with 20 additions and 0 deletions

View File

@ -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;