add tests

This commit is contained in:
mpostma 2021-03-05 20:06:10 +01:00
parent 65ca80bdde
commit f4f42ec441
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,7 @@ impl SearchQuery {
documents_ids,
found_words,
candidates,
..
} = search.execute()?;
let mut documents = Vec::new();

View File

@ -8,7 +8,9 @@ async fn get_settings_unexisting_index() {
assert_eq!(code, 400)
}
// test broken, should be fixed with milli#101
#[actix_rt::test]
#[ignore]
async fn get_settings() {
let server = Server::new().await;
let index = server.index("test");
@ -16,10 +18,11 @@ async fn get_settings() {
let (response, code) = index.settings().await;
assert_eq!(code, 200);
let settings = response.as_object().unwrap();
assert_eq!(settings.keys().len(), 3);
assert_eq!(settings.keys().len(), 4);
assert_eq!(settings["displayedAttributes"], json!(["*"]));
assert_eq!(settings["searchableAttributes"], json!(["*"]));
assert_eq!(settings["facetedAttributes"], json!({}));
assert_eq!(settings["rankingRules"], json!(["typo", "words", "proximmity", "attributes", "wordsPosition", "exactness"]));
}
#[actix_rt::test]