test delete settings

This commit is contained in:
mpostma 2021-02-24 10:14:36 +01:00
parent 7d9c5f64aa
commit 3f939f3ccf
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
2 changed files with 15 additions and 0 deletions

View File

@ -141,6 +141,11 @@ impl Index<'_> {
let url = format!("/indexes/{}/settings", self.uid);
self.service.post(url, settings).await
}
pub async fn delete_settings(&self) -> (Value, StatusCode) {
let url = format!("/indexes/{}/settings", self.uid);
self.service.delete(url).await
}
}
pub struct GetDocumentOptions;

View File

@ -50,6 +50,16 @@ async fn test_partial_update() {
assert_eq!(response["searchableAttributes"],json!(["bar"]));
}
#[actix_rt::test]
#[ignore]
// need fix #54
async fn delete_settings_unexisting_index() {
let server = Server::new().await;
let index = server.index("test");
let (_response, code) = index.delete_settings().await;
assert_eq!(code, 400);
}
#[actix_rt::test]
async fn update_setting_unexisting_index() {
let server = Server::new().await;