mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
fix the wrong error code on minWordSizeForTypos
This commit is contained in:
parent
41a970247e
commit
0f727d079b
4 changed files with 32 additions and 6 deletions
|
@ -243,6 +243,18 @@ async fn settings_bad_typo_tolerance() {
|
|||
}
|
||||
"###);
|
||||
|
||||
let (response, code) =
|
||||
index.update_settings(json!({ "typoTolerance": { "minWordSizeForTypos": "doggo" }})).await;
|
||||
snapshot!(code, @"400 Bad Request");
|
||||
snapshot!(json_string!(response), @r###"
|
||||
{
|
||||
"message": "Invalid value type at `.typoTolerance.minWordSizeForTypos`: expected an object, but found a string: `\"doggo\"`",
|
||||
"code": "invalid_settings_typo_tolerance",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-settings-typo-tolerance"
|
||||
}
|
||||
"###);
|
||||
|
||||
let (response, code) = index.update_settings_typo_tolerance(json!("doggo")).await;
|
||||
snapshot!(code, @"400 Bad Request");
|
||||
snapshot!(json_string!(response), @r###"
|
||||
|
@ -253,6 +265,21 @@ async fn settings_bad_typo_tolerance() {
|
|||
"link": "https://docs.meilisearch.com/errors#invalid-settings-typo-tolerance"
|
||||
}
|
||||
"###);
|
||||
|
||||
let (response, code) = index
|
||||
.update_settings_typo_tolerance(
|
||||
json!({ "typoTolerance": { "minWordSizeForTypos": "doggo" }}),
|
||||
)
|
||||
.await;
|
||||
snapshot!(code, @"400 Bad Request");
|
||||
snapshot!(json_string!(response), @r###"
|
||||
{
|
||||
"message": "Unknown field `typoTolerance`: expected one of `enabled`, `minWordSizeForTypos`, `disableOnWords`, `disableOnAttributes`",
|
||||
"code": "invalid_settings_typo_tolerance",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#invalid-settings-typo-tolerance"
|
||||
}
|
||||
"###);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue