From 5dd582918d3791fa796c9e75a26e4145338f89a0 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Thu, 19 Jan 2023 17:21:08 +0100 Subject: [PATCH 1/2] Add test --- meilisearch/tests/search/errors.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meilisearch/tests/search/errors.rs b/meilisearch/tests/search/errors.rs index f50edd13f..fb232e9d3 100644 --- a/meilisearch/tests/search/errors.rs +++ b/meilisearch/tests/search/errors.rs @@ -512,6 +512,17 @@ async fn search_bad_matching_strategy() { } "###); + let (response, code) = index.search_post(json!({"matchingStrategy": {"doggo": "doggo"}})).await; + snapshot!(code, @"400 Bad Request"); + snapshot!(json_string!(response), @r###" + { + "message": "Invalid value type at `.matchingStrategy`: expected a string, but found an object: `{\"doggo\":\"doggo\"}`", + "code": "invalid_search_matching_strategy", + "type": "invalid_request", + "link": "https://docs.meilisearch.com/errors#invalid-search-matching-strategy" + } + "###); + let (response, code) = index.search_get("matchingStrategy=doggo").await; snapshot!(code, @"400 Bad Request"); snapshot!(json_string!(response), @r###" From 57682cbabeaa0910108777594ff46d2dfc833c1d Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 23 Jan 2023 15:42:58 +0100 Subject: [PATCH 2/2] Fix test url after #3398 --- meilisearch/tests/search/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch/tests/search/errors.rs b/meilisearch/tests/search/errors.rs index fb232e9d3..9c30b09ba 100644 --- a/meilisearch/tests/search/errors.rs +++ b/meilisearch/tests/search/errors.rs @@ -519,7 +519,7 @@ async fn search_bad_matching_strategy() { "message": "Invalid value type at `.matchingStrategy`: expected a string, but found an object: `{\"doggo\":\"doggo\"}`", "code": "invalid_search_matching_strategy", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid-search-matching-strategy" + "link": "https://docs.meilisearch.com/errors#invalid_search_matching_strategy" } "###);