Rename function, add trailing line, replace JSON string with macro

This commit is contained in:
Pedro Paulo de Amorim 2020-03-31 13:13:09 +01:00
parent 51472142c6
commit fbf7117d6a

View File

@ -79,7 +79,7 @@ fn check_add_documents_with_nested_boolean() {
// Test issue https://github.com/meilisearch/MeiliSearch/issues/571 // Test issue https://github.com/meilisearch/MeiliSearch/issues/571
#[test] #[test]
fn check_add_documents_with_nested_sequence() { fn check_add_documents_with_nested_null() {
let mut server = common::Server::with_uid("tasks"); let mut server = common::Server::with_uid("tasks");
// 1 - Create the index with no primary_key // 1 - Create the index with no primary_key
@ -91,7 +91,12 @@ fn check_add_documents_with_nested_sequence() {
// 2 - Add a document that contains a null in a nested object // 2 - Add a document that contains a null in a nested object
let body = serde_json::from_str("[{\"id\":0,\"foo\":{\"bar\":null}}]").unwrap(); let body = json!([{
"id": 0,
"foo": {
"bar": null
}
}]);
let url = "/indexes/tasks/documents"; let url = "/indexes/tasks/documents";
let (response, status_code) = server.post_request(&url, body); let (response, status_code) = server.post_request(&url, body);