mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
add test for ranking rules settings
This commit is contained in:
parent
6167a10e5e
commit
60a90e96f3
@ -455,3 +455,17 @@ async fn attributes_for_faceting_settings() {
|
||||
let (response, _status_code) = server.get_request("/indexes/test/settings/attributes-for-faceting").await;
|
||||
assert_eq!(response, json!([]));
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn setting_ranking_rules_dont_mess_with_other_settings() {
|
||||
let mut server = common::Server::test_server().await;
|
||||
let body = json!({
|
||||
"rankingRules": ["asc(foobar)"]
|
||||
});
|
||||
server.update_all_settings(body).await;
|
||||
let (response, _) = server.get_all_settings().await;
|
||||
assert_eq!(response["rankingRules"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(response["rankingRules"].as_array().unwrap().first().unwrap().as_str().unwrap(), "asc(foobar)");
|
||||
assert!(!response["searchableAttributes"].as_array().unwrap().iter().any(|e| e.as_str().unwrap() == "foobar"));
|
||||
assert!(!response["displayedAttributes"].as_array().unwrap().iter().any(|e| e.as_str().unwrap() == "foobar"));
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ async fn write_custom_ranking_and_index_documents() {
|
||||
|
||||
let expected = json!({
|
||||
"id": 1,
|
||||
"title": "Le Petit Prince",
|
||||
"author": "Exupéry"
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user