mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
update documents_delete tests to use the test dataset
This commit is contained in:
parent
92d9283d1a
commit
75d0d2df6c
@ -2,30 +2,33 @@ mod common;
|
|||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn delete() {
|
async fn delete() {
|
||||||
let mut server = common::Server::with_uid("movies");
|
let mut server = common::Server::test_server().await;
|
||||||
server.populate_movies().await;
|
|
||||||
|
|
||||||
let (_response, status_code) = server.get_document(419704).await;
|
let (_response, status_code) = server.get_document(50).await;
|
||||||
assert_eq!(status_code, 200);
|
assert_eq!(status_code, 200);
|
||||||
|
|
||||||
server.delete_document(419704).await;
|
server.delete_document(50).await;
|
||||||
|
|
||||||
let (_response, status_code) = server.get_document(419704).await;
|
let (_response, status_code) = server.get_document(50).await;
|
||||||
assert_eq!(status_code, 404);
|
assert_eq!(status_code, 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve the issue https://github.com/meilisearch/MeiliSearch/issues/493
|
// Resolve the issue https://github.com/meilisearch/MeiliSearch/issues/493
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn delete_batch() {
|
async fn delete_batch() {
|
||||||
let mut server = common::Server::with_uid("movies");
|
let mut server = common::Server::test_server().await;
|
||||||
server.populate_movies().await;
|
|
||||||
|
|
||||||
let (_response, status_code) = server.get_document(419704).await;
|
let doc_ids = vec!(50, 55, 60);
|
||||||
assert_eq!(status_code, 200);
|
for doc_id in &doc_ids {
|
||||||
|
let (_response, status_code) = server.get_document(doc_id).await;
|
||||||
|
assert_eq!(status_code, 200);
|
||||||
|
}
|
||||||
|
|
||||||
let body = serde_json::json!([419704, 512200, 181812]);
|
let body = serde_json::json!(&doc_ids);
|
||||||
server.delete_multiple_documents(body).await;
|
server.delete_multiple_documents(body).await;
|
||||||
|
|
||||||
let (_response, status_code) = server.get_document(419704).await;
|
for doc_id in &doc_ids {
|
||||||
assert_eq!(status_code, 404);
|
let (_response, status_code) = server.get_document(doc_id).await;
|
||||||
|
assert_eq!(status_code, 404);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user