add test for ranking rules settings
@@ -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"));
+}
