mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Fix some errors
This commit is contained in:
parent
61c15b69fb
commit
7464720426
27 changed files with 347 additions and 234 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue