mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
Test get distinct attribute
This commit is contained in:
parent
feb12a581e
commit
b1272d05b4
@ -677,3 +677,17 @@ async fn search_with_settings_searchable_attributes_2() {
|
|||||||
let (response, _status_code) = server.search_get(query).await;
|
let (response, _status_code) = server.search_get(query).await;
|
||||||
assert_json_eq!(expect, response["hits"].clone(), ordered: false);
|
assert_json_eq!(expect, response["hits"].clone(), ordered: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// issue #798
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn distinct_attributes_returns_name_not_id() {
|
||||||
|
let mut server = common::Server::test_server().await;
|
||||||
|
let settings = json!({
|
||||||
|
"distinctAttribute": "color",
|
||||||
|
});
|
||||||
|
server.update_all_settings(settings).await;
|
||||||
|
let (response, _) = server.get_all_settings().await;
|
||||||
|
assert_eq!(response["distinctAttribute"], "color");
|
||||||
|
let (response, _) = server.get_distinct_attribute().await;
|
||||||
|
assert_eq!(response, "color");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user