From 7c646e031c4987815b2fbf8a317358d48d742147 Mon Sep 17 00:00:00 2001 From: gorogoroumaru Date: Sat, 10 Oct 2020 02:43:09 +0000 Subject: [PATCH] update test --- meilisearch-http/tests/settings.rs | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/meilisearch-http/tests/settings.rs b/meilisearch-http/tests/settings.rs index 92114faa3..6b125c13a 100644 --- a/meilisearch-http/tests/settings.rs +++ b/meilisearch-http/tests/settings.rs @@ -468,3 +468,56 @@ async fn settings_that_contains_wildcard_is_wildcard() { assert_eq!(response["searchableAttributes"].as_array().unwrap()[0], "*"); assert_eq!(response["displayedAttributes"].as_array().unwrap()[0], "*"); } + +#[actix_rt::test] +async fn test_displayed_attributes_field() { + let mut server = common::Server::test_server().await; + + let body = json!({ + "rankingRules": [ + "typo", + "words", + "proximity", + "attribute", + "wordsPosition", + "exactness", + "desc(registered)", + "desc(age)", + ], + "distinctAttribute": "id", + "searchableAttributes": [ + "id", + "name", + "color", + "gender", + "email", + "phone", + "address", + "registered", + "about" + ], + "displayedAttributes": [ + "age", + "email", + "gender", + "name", + "registered", + ], + "stopWords": [ + "ad", + "in", + "ut", + ], + "synonyms": { + "road": ["avenue", "street"], + "street": ["avenue"], + }, + "attributesForFaceting": ["name"], + }); + + server.update_all_settings(body.clone()).await; + + let (response, _status_code) = server.get_all_settings().await; + + assert_json_eq!(body, response, ordered: true); +} \ No newline at end of file