mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
test add document bad primary key
This commit is contained in:
parent
ded6483173
commit
4bca26298e
@ -208,3 +208,21 @@ async fn add_larger_dataset() {
|
|||||||
assert_eq!(response["status"], "processed");
|
assert_eq!(response["status"], "processed");
|
||||||
assert_eq!(response["success"]["DocumentsAddition"]["nb_documents"], 77);
|
assert_eq!(response["success"]["DocumentsAddition"]["nb_documents"], 77);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn add_documents_bad_primary_key() {
|
||||||
|
let server = Server::new().await;
|
||||||
|
let index = server.index("test");
|
||||||
|
index.create(Some("docid")).await;
|
||||||
|
let documents = json!([
|
||||||
|
{
|
||||||
|
"docid": "foo & bar",
|
||||||
|
"content": "foobar"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
index.add_documents(documents, None).await;
|
||||||
|
index.wait_update_id(0).await;
|
||||||
|
let (response, code) = index.get_update(0).await;
|
||||||
|
assert_eq!(code, 200);
|
||||||
|
assert_eq!(response["status"], "failed");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user