From 07bb1e2c4e81ddd4f4089c584e933da1680f9ad5 Mon Sep 17 00:00:00 2001 From: mpostma Date: Mon, 15 Mar 2021 18:38:13 +0100 Subject: [PATCH] fix tests --- meilisearch-http/tests/index/create_index.rs | 6 ++++-- meilisearch-http/tests/index/get_index.rs | 3 ++- meilisearch-http/tests/index/update_index.rs | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/tests/index/create_index.rs b/meilisearch-http/tests/index/create_index.rs index 003bbfc58..a61524d04 100644 --- a/meilisearch-http/tests/index/create_index.rs +++ b/meilisearch-http/tests/index/create_index.rs @@ -9,11 +9,12 @@ async fn create_index_no_primary_key() { assert_eq!(code, 200); assert_eq!(response["uid"], "test"); + assert_eq!(response["name"], "test"); assert!(response.get("createdAt").is_some()); assert!(response.get("updatedAt").is_some()); assert_eq!(response["createdAt"], response["updatedAt"]); assert_eq!(response["primaryKey"], Value::Null); - assert_eq!(response.as_object().unwrap().len(), 4); + assert_eq!(response.as_object().unwrap().len(), 5); } #[actix_rt::test] @@ -24,11 +25,12 @@ async fn create_index_with_primary_key() { assert_eq!(code, 200); assert_eq!(response["uid"], "test"); + assert_eq!(response["name"], "test"); assert!(response.get("createdAt").is_some()); assert!(response.get("updatedAt").is_some()); //assert_eq!(response["createdAt"], response["updatedAt"]); assert_eq!(response["primaryKey"], "primary"); - assert_eq!(response.as_object().unwrap().len(), 4); + assert_eq!(response.as_object().unwrap().len(), 5); } // TODO: partial test since we are testing error, amd error is not yet fully implemented in diff --git a/meilisearch-http/tests/index/get_index.rs b/meilisearch-http/tests/index/get_index.rs index 2ba7b86e4..8671d85cd 100644 --- a/meilisearch-http/tests/index/get_index.rs +++ b/meilisearch-http/tests/index/get_index.rs @@ -13,11 +13,12 @@ async fn create_and_get_index() { assert_eq!(code, 200); assert_eq!(response["uid"], "test"); + assert_eq!(response["name"], "test"); assert!(response.get("createdAt").is_some()); assert!(response.get("updatedAt").is_some()); assert_eq!(response["createdAt"], response["updatedAt"]); assert_eq!(response["primaryKey"], Value::Null); - assert_eq!(response.as_object().unwrap().len(), 4); + assert_eq!(response.as_object().unwrap().len(), 5); } // TODO: partial test since we are testing error, amd error is not yet fully implemented in diff --git a/meilisearch-http/tests/index/update_index.rs b/meilisearch-http/tests/index/update_index.rs index 36670682a..9c78ccb16 100644 --- a/meilisearch-http/tests/index/update_index.rs +++ b/meilisearch-http/tests/index/update_index.rs @@ -13,6 +13,7 @@ async fn update_primary_key() { assert_eq!(code, 200); assert_eq!(response["uid"], "test"); + assert_eq!(response["name"], "test"); assert!(response.get("createdAt").is_some()); assert!(response.get("updatedAt").is_some()); @@ -21,7 +22,7 @@ async fn update_primary_key() { assert!(created_at < updated_at); assert_eq!(response["primaryKey"], "primary"); - assert_eq!(response.as_object().unwrap().len(), 4); + assert_eq!(response.as_object().unwrap().len(), 5); } #[actix_rt::test]