Skip to content

Commit 83d06ed

Browse files
committed
fix the test
1 parent 19a67f6 commit 83d06ed

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/indexes.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,21 +2063,31 @@ mod tests {
20632063

20642064
#[meilisearch_test]
20652065
async fn test_update_document_json(client: Client, index: Index) -> Result<(), Error> {
2066-
let old_json = r#"{ "id": 1, "body": "doggo" }{ "id": 2, "body": "catto" }"#.as_bytes();
2067-
let updated_json = r#"{ "id": 1, "second_body": "second_doggo" }{ "id": 2, "second_body": "second_catto" }"#.as_bytes();
2066+
let old_json = [
2067+
json!({ "id": 1, "body": "doggo" }),
2068+
json!({ "id": 2, "body": "catto" }),
2069+
];
2070+
let updated_json = [
2071+
json!({ "id": 1, "second_body": "second_doggo" }),
2072+
json!({ "id": 2, "second_body": "second_catto" }),
2073+
];
20682074

20692075
let task = index
2070-
.add_documents(old_json, Some("id"))
2071-
.await?
2076+
.add_documents(&old_json, Some("id"))
2077+
.await
2078+
.unwrap()
20722079
.wait_for_completion(&client, None, None)
2073-
.await?;
2080+
.await
2081+
.unwrap();
20742082
let _ = index.get_task(task).await?;
20752083

20762084
let task = index
2077-
.add_or_update(updated_json, None)
2078-
.await?
2085+
.add_or_update(&updated_json, None)
2086+
.await
2087+
.unwrap()
20792088
.wait_for_completion(&client, None, None)
2080-
.await?;
2089+
.await
2090+
.unwrap();
20812091

20822092
let status = index.get_task(task).await?;
20832093
let elements = index.get_documents::<serde_json::Value>().await.unwrap();

0 commit comments

Comments
 (0)