mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-26 16:21:07 +00:00
Fix some errors
This commit is contained in:
@ -44,14 +44,23 @@ async fn update_nothing() {
|
||||
async fn error_update_existing_primary_key() {
|
||||
let server = Server::new().await;
|
||||
let index = server.index("test");
|
||||
let (_response, code) = index.create(Some("primary")).await;
|
||||
let (_response, code) = index.create(Some("id")).await;
|
||||
|
||||
assert_eq!(code, 201);
|
||||
|
||||
let (response, code) = index.update(Some("primary2")).await;
|
||||
let documents = json!([
|
||||
{
|
||||
"id": "11",
|
||||
"content": "foobar"
|
||||
}
|
||||
]);
|
||||
index.add_documents(documents, None).await;
|
||||
index.wait_update_id(0).await;
|
||||
|
||||
let (response, code) = index.update(Some("primary")).await;
|
||||
|
||||
let expected_response = json!({
|
||||
"message": "Index test already has a primary key.",
|
||||
"message": "Index already has a primary key: `id`.",
|
||||
"code": "index_primary_key_already_exists",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#index_primary_key_already_exists"
|
||||
@ -67,7 +76,7 @@ async fn error_update_unexisting_index() {
|
||||
let (response, code) = server.index("test").update(None).await;
|
||||
|
||||
let expected_response = json!({
|
||||
"message": "Index test not found.",
|
||||
"message": "Index `test` not found.",
|
||||
"code": "index_not_found",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#index_not_found"
|
||||
|
Reference in New Issue
Block a user