mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Fix tests
This commit is contained in:
parent
b0c33ed6d2
commit
72e2b220ed
20 changed files with 217 additions and 217 deletions
|
@ -205,7 +205,7 @@ async fn error_add_api_key_no_header() {
|
|||
"message": "The Authorization header is missing. It must use the bearer authorization method.",
|
||||
"code": "missing_authorization_header",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-authorization-header"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ async fn error_add_api_key_bad_key() {
|
|||
"message": "The provided API key is invalid.",
|
||||
"code": "invalid_api_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ async fn error_add_api_key_missing_parameter() {
|
|||
"message": "Missing field `indexes`",
|
||||
"code": "missing_api_key_indexes",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-api-key-indexes"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_api_key_indexes"
|
||||
}
|
||||
"###);
|
||||
|
||||
|
@ -268,7 +268,7 @@ async fn error_add_api_key_missing_parameter() {
|
|||
"message": "Missing field `actions`",
|
||||
"code": "missing_api_key_actions",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-api-key-actions"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_api_key_actions"
|
||||
}
|
||||
"###);
|
||||
|
||||
|
@ -285,7 +285,7 @@ async fn error_add_api_key_missing_parameter() {
|
|||
"message": "Missing field `expiresAt`",
|
||||
"code": "missing_api_key_expires_at",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-api-key-expires-at"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_api_key_expires_at"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ async fn error_add_api_key_invalid_parameters_description() {
|
|||
"message": "Invalid value type at `.description`: expected a string, but found an object: `{\"name\":\"products\"}`",
|
||||
"code": "invalid_api_key_description",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-description"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_description"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ async fn error_add_api_key_invalid_parameters_name() {
|
|||
"message": "Invalid value type at `.name`: expected a string, but found an object: `{\"name\":\"products\"}`",
|
||||
"code": "invalid_api_key_name",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-name"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_name"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ async fn error_add_api_key_invalid_parameters_indexes() {
|
|||
"message": "Invalid value type at `.indexes`: expected an array, but found an object: `{\"name\":\"products\"}`",
|
||||
"code": "invalid_api_key_indexes",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-indexes"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_indexes"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ async fn error_add_api_key_invalid_index_uids() {
|
|||
"message": "Invalid value at `.indexes[0]`: `invalid index # / \\name with spaces` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).",
|
||||
"code": "invalid_api_key_indexes",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-indexes"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_indexes"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -405,7 +405,7 @@ async fn error_add_api_key_invalid_parameters_actions() {
|
|||
"message": "Invalid value type at `.actions`: expected an array, but found an object: `{\"name\":\"products\"}`",
|
||||
"code": "invalid_api_key_actions",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-actions"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_actions"
|
||||
}
|
||||
"###);
|
||||
|
||||
|
@ -425,7 +425,7 @@ async fn error_add_api_key_invalid_parameters_actions() {
|
|||
"message": "Unknown value `doc.add` at `.actions[0]`: expected one of `*`, `search`, `documents.*`, `documents.add`, `documents.get`, `documents.delete`, `indexes.*`, `indexes.create`, `indexes.get`, `indexes.update`, `indexes.delete`, `indexes.swap`, `tasks.*`, `tasks.cancel`, `tasks.delete`, `tasks.get`, `settings.*`, `settings.get`, `settings.update`, `stats.*`, `stats.get`, `metrics.*`, `metrics.get`, `dumps.*`, `dumps.create`, `version`, `keys.create`, `keys.get`, `keys.update`, `keys.delete`",
|
||||
"code": "invalid_api_key_actions",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-actions"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_actions"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ async fn error_add_api_key_invalid_parameters_expires_at() {
|
|||
"message": "Invalid value type at `.expiresAt`: expected a string, but found an object: `{\"name\":\"products\"}`",
|
||||
"code": "invalid_api_key_expires_at",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-expires-at"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_expires_at"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ async fn error_add_api_key_invalid_parameters_expires_at_in_the_past() {
|
|||
"message": "Invalid value at `.expiresAt`: `2010-11-13T00:00:00Z` is not a valid date. It should follow the RFC 3339 format to represents a date or datetime in the future or specified as a null value. e.g. 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'.\n",
|
||||
"code": "invalid_api_key_expires_at",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-expires-at"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_expires_at"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -497,7 +497,7 @@ async fn error_add_api_key_invalid_parameters_uid() {
|
|||
"message": "Invalid value at `.uid`: invalid length: expected length 32 for simple format, found 13",
|
||||
"code": "invalid_api_key_uid",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-uid"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_uid"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -542,7 +542,7 @@ async fn error_add_api_key_parameters_uid_already_exist() {
|
|||
"message": "`uid` field value `4bc0887a-0e41-4f3b-935d-0c451dcee9c8` is already an existing API key.",
|
||||
"code": "api_key_already_exists",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#api-key-already-exists"
|
||||
"link": "https://docs.meilisearch.com/errors#api_key_already_exists"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"409 Conflict");
|
||||
|
@ -688,7 +688,7 @@ async fn error_get_api_key_no_header() {
|
|||
"message": "The Authorization header is missing. It must use the bearer authorization method.",
|
||||
"code": "missing_authorization_header",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-authorization-header"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -707,7 +707,7 @@ async fn error_get_api_key_bad_key() {
|
|||
"message": "The provided API key is invalid.",
|
||||
"code": "invalid_api_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"403 Forbidden");
|
||||
|
@ -726,7 +726,7 @@ async fn error_get_api_key_not_found() {
|
|||
"message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.",
|
||||
"code": "api_key_not_found",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#api-key-not-found"
|
||||
"link": "https://docs.meilisearch.com/errors#api_key_not_found"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"404 Not Found");
|
||||
|
@ -870,7 +870,7 @@ async fn error_list_api_keys_no_header() {
|
|||
"message": "The Authorization header is missing. It must use the bearer authorization method.",
|
||||
"code": "missing_authorization_header",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-authorization-header"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -887,7 +887,7 @@ async fn error_list_api_keys_bad_key() {
|
|||
"message": "The provided API key is invalid.",
|
||||
"code": "invalid_api_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"403 Forbidden");
|
||||
|
@ -964,7 +964,7 @@ async fn delete_api_key() {
|
|||
"message": "[ignored]",
|
||||
"code": "api_key_not_found",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#api-key-not-found"
|
||||
"link": "https://docs.meilisearch.com/errors#api_key_not_found"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"404 Not Found");
|
||||
|
@ -983,7 +983,7 @@ async fn error_delete_api_key_no_header() {
|
|||
"message": "The Authorization header is missing. It must use the bearer authorization method.",
|
||||
"code": "missing_authorization_header",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-authorization-header"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1002,7 +1002,7 @@ async fn error_delete_api_key_bad_key() {
|
|||
"message": "The provided API key is invalid.",
|
||||
"code": "invalid_api_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"403 Forbidden");
|
||||
|
@ -1021,7 +1021,7 @@ async fn error_delete_api_key_not_found() {
|
|||
"message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.",
|
||||
"code": "api_key_not_found",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#api-key-not-found"
|
||||
"link": "https://docs.meilisearch.com/errors#api_key_not_found"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"404 Not Found");
|
||||
|
@ -1397,7 +1397,7 @@ async fn error_patch_api_key_indexes() {
|
|||
"message": "Unknown field `indexes`: expected one of `description`, `name`",
|
||||
"code": "immutable_api_key_indexes",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#immutable-api-key-indexes"
|
||||
"link": "https://docs.meilisearch.com/errors#immutable_api_key_indexes"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -1474,7 +1474,7 @@ async fn error_patch_api_key_actions() {
|
|||
"message": "Unknown field `actions`: expected one of `description`, `name`",
|
||||
"code": "immutable_api_key_actions",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#immutable-api-key-actions"
|
||||
"link": "https://docs.meilisearch.com/errors#immutable_api_key_actions"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -1543,7 +1543,7 @@ async fn error_patch_api_key_expiration_date() {
|
|||
"message": "Unknown field `expiresAt`: expected one of `description`, `name`",
|
||||
"code": "immutable_api_key_expires_at",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#immutable-api-key-expires-at"
|
||||
"link": "https://docs.meilisearch.com/errors#immutable_api_key_expires_at"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -1565,7 +1565,7 @@ async fn error_patch_api_key_no_header() {
|
|||
"message": "The Authorization header is missing. It must use the bearer authorization method.",
|
||||
"code": "missing_authorization_header",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-authorization-header"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1588,7 +1588,7 @@ async fn error_patch_api_key_bad_key() {
|
|||
"message": "The provided API key is invalid.",
|
||||
"code": "invalid_api_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"403 Forbidden");
|
||||
|
@ -1611,7 +1611,7 @@ async fn error_patch_api_key_not_found() {
|
|||
"message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.",
|
||||
"code": "api_key_not_found",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#api-key-not-found"
|
||||
"link": "https://docs.meilisearch.com/errors#api_key_not_found"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"404 Not Found");
|
||||
|
@ -1664,7 +1664,7 @@ async fn error_patch_api_key_indexes_invalid_parameters() {
|
|||
"message": "Invalid value type at `.description`: expected a string, but found a positive integer: `13`",
|
||||
"code": "invalid_api_key_description",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-description"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_description"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -1680,7 +1680,7 @@ async fn error_patch_api_key_indexes_invalid_parameters() {
|
|||
"message": "Invalid value type at `.name`: expected a string, but found a positive integer: `13`",
|
||||
"code": "invalid_api_key_name",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-api-key-name"
|
||||
"link": "https://docs.meilisearch.com/errors#invalid_api_key_name"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||
|
@ -1696,7 +1696,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1707,7 +1707,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1718,7 +1718,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1729,7 +1729,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1742,7 +1742,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1753,7 +1753,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1764,7 +1764,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
@ -1775,7 +1775,7 @@ async fn error_access_api_key_routes_no_master_key_set() {
|
|||
"message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.",
|
||||
"code": "missing_master_key",
|
||||
"type": "auth",
|
||||
"link": "https://docs.meilisearch.com/errors#missing-master-key"
|
||||
"link": "https://docs.meilisearch.com/errors#missing_master_key"
|
||||
}
|
||||
"###);
|
||||
meili_snap::snapshot!(code, @"401 Unauthorized");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue