mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
fix tests
This commit is contained in:
parent
9681ffca52
commit
2f3a439566
@ -61,7 +61,7 @@ async fn get_no_documents() {
|
|||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(None).await;
|
let (_, code) = index.create(None).await;
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (response, code) = index
|
let (response, code) = index
|
||||||
.get_all_documents(GetAllDocumentsOptions::default())
|
.get_all_documents(GetAllDocumentsOptions::default())
|
||||||
|
@ -7,7 +7,7 @@ async fn create_index_no_primary_key() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (response, code) = index.create(None).await;
|
let (response, code) = index.create(None).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
assert_eq!(response["uid"], "test");
|
assert_eq!(response["uid"], "test");
|
||||||
assert_eq!(response["name"], "test");
|
assert_eq!(response["name"], "test");
|
||||||
assert!(response.get("createdAt").is_some());
|
assert!(response.get("createdAt").is_some());
|
||||||
@ -23,7 +23,7 @@ async fn create_index_with_primary_key() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (response, code) = index.create(Some("primary")).await;
|
let (response, code) = index.create(Some("primary")).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
assert_eq!(response["uid"], "test");
|
assert_eq!(response["uid"], "test");
|
||||||
assert_eq!(response["name"], "test");
|
assert_eq!(response["name"], "test");
|
||||||
assert!(response.get("createdAt").is_some());
|
assert!(response.get("createdAt").is_some());
|
||||||
@ -41,7 +41,7 @@ async fn create_existing_index() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(Some("primary")).await;
|
let (_, code) = index.create(Some("primary")).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (_response, code) = index.create(Some("primary")).await;
|
let (_response, code) = index.create(Some("primary")).await;
|
||||||
assert_eq!(code, 400);
|
assert_eq!(code, 400);
|
||||||
|
@ -8,7 +8,7 @@ async fn create_and_delete_index() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_response, code) = index.create(None).await;
|
let (_response, code) = index.create(None).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (_response, code) = index.delete().await;
|
let (_response, code) = index.delete().await;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ async fn create_and_get_index() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(None).await;
|
let (_, code) = index.create(None).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (response, code) = index.get().await;
|
let (response, code) = index.get().await;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ async fn stats() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(Some("id")).await;
|
let (_, code) = index.create(Some("id")).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (response, code) = index.stats().await;
|
let (response, code) = index.stats().await;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ async fn update_primary_key() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(None).await;
|
let (_, code) = index.create(None).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (response, code) = index.update(Some("primary")).await;
|
let (response, code) = index.update(Some("primary")).await;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ async fn update_nothing() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (response, code) = index.create(None).await;
|
let (response, code) = index.create(None).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (update, code) = index.update(None).await;
|
let (update, code) = index.update(None).await;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ async fn update_existing_primary_key() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_response, code) = index.create(Some("primary")).await;
|
let (_response, code) = index.create(Some("primary")).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (_update, code) = index.update(Some("primary2")).await;
|
let (_update, code) = index.update(Some("primary2")).await;
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ macro_rules! test_setting_routes {
|
|||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (response, code) = index.create(None).await;
|
let (response, code) = index.create(None).await;
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 201, "{}", response);
|
||||||
let url = format!("/indexes/test/settings/{}",
|
let url = format!("/indexes/test/settings/{}",
|
||||||
stringify!($setting)
|
stringify!($setting)
|
||||||
.chars()
|
.chars()
|
||||||
|
@ -28,7 +28,7 @@ async fn stats() {
|
|||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
let (_, code) = index.create(Some("id")).await;
|
let (_, code) = index.create(Some("id")).await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 201);
|
||||||
|
|
||||||
let (response, code) = server.stats().await;
|
let (response, code) = server.stats().await;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user