mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
test reset attributes to wildcard
This commit is contained in:
parent
36b763b84e
commit
de4caef468
@ -93,6 +93,7 @@ pub fn apply_settings_update(
|
||||
}
|
||||
},
|
||||
UpdateState::Clear => {
|
||||
println!("\n\n\n\nHERRE\n\n\n");
|
||||
schema.set_all_fields_as_displayed();
|
||||
},
|
||||
UpdateState::Nothing => (),
|
||||
|
@ -420,3 +420,17 @@ async fn setting_ranking_rules_dont_mess_with_other_settings() {
|
||||
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"));
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn displayed_and_searchable_attributes_reset_to_wildcard() {
|
||||
let mut server = common::Server::test_server().await;
|
||||
server.update_all_settings(json!({ "searchableAttributes": ["color"], "displayedAttributes": ["color"] })).await;
|
||||
let (response, _) = server.get_all_settings().await;
|
||||
assert_eq!(response["searchableAttributes"].as_array().unwrap()[0], "color");
|
||||
assert_eq!(response["displayedAttributes"].as_array().unwrap()[0], "color");
|
||||
server.delete_searchable_attributes().await;
|
||||
server.delete_displayed_attributes().await;
|
||||
let (response, _) = server.get_all_settings().await;
|
||||
assert_eq!(response["searchableAttributes"].as_array().unwrap()[0], "*");
|
||||
assert_eq!(response["displayedAttributes"].as_array().unwrap()[0], "*");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user