fix bug and add tests

- add tests about updates
- fix select bug

fix #896
This commit is contained in:
many
2020-07-13 18:22:18 +02:00
parent cb267b68ed
commit 94b3e8e56e
5 changed files with 206 additions and 30 deletions

View File

@ -663,30 +663,3 @@ async fn check_add_documents_without_primary_key() {
assert_eq!(status_code, 400);
}
#[actix_rt::test]
async fn check_first_update_should_bring_up_processed_status_after_first_docs_addition() {
let mut server = common::Server::with_uid("test");
let body = json!({
"uid": "test",
});
// 1. Create Index
let (response, status_code) = server.create_index(body).await;
assert_eq!(status_code, 201);
assert_eq!(response["primaryKey"], json!(null));
let dataset = include_bytes!("assets/test_set.json");
let body: Value = serde_json::from_slice(dataset).unwrap();
// 2. Index the documents from movies.json, present inside of assets directory
server.add_or_replace_multiple_documents(body).await;
// 3. Fetch the status of the indexing done above.
let (response, status_code) = server.get_all_updates_status().await;
// 4. Verify the fetch is successful and indexing status is 'processed'
assert_eq!(status_code, 200);
assert_eq!(response[0]["status"], "processed");
}