mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-18 20:57:35 +02:00
Merge pull request #5682 from martin-g/faster-documents-update_documents-it-tests
tests: Faster documents::update_documents IT tests
This commit is contained in:
commit
9a729bf31d
@ -6,19 +6,18 @@ use crate::json;
|
|||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn error_document_update_create_index_bad_uid() {
|
async fn error_document_update_create_index_bad_uid() {
|
||||||
let server = Server::new().await;
|
let server = Server::new_shared();
|
||||||
let index = server.index("883 fj!");
|
let index = server.unique_index_with_prefix("883 fj!");
|
||||||
let (response, code) = index.update_documents(json!([{"id": 1}]), None).await;
|
let (response, code) = index.update_documents(json!([{"id": 1}]), None).await;
|
||||||
|
|
||||||
let expected_response = json!({
|
snapshot!(code, @"400 Bad Request");
|
||||||
"message": "`883 fj!` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_), and can not be more than 512 bytes.",
|
snapshot!(json_string!(response), @r###"
|
||||||
|
{
|
||||||
|
"message": "`883 fj!-[uuid]` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_), and can not be more than 512 bytes.",
|
||||||
"code": "invalid_index_uid",
|
"code": "invalid_index_uid",
|
||||||
"type": "invalid_request",
|
"type": "invalid_request",
|
||||||
"link": "https://docs.meilisearch.com/errors#invalid_index_uid"
|
"link": "https://docs.meilisearch.com/errors#invalid_index_uid"
|
||||||
});
|
}"###);
|
||||||
|
|
||||||
assert_eq!(code, 400);
|
|
||||||
assert_eq!(response, expected_response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user