mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Added support for specifying compression in tests
Refactored tests code to allow to specify compression (content-encoding) algorithm. Added tests to verify what actix actually handle different content encodings properly.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
use crate::common::encoder::Encoder;
|
||||
use crate::common::Server;
|
||||
use serde_json::json;
|
||||
use time::{format_description::well_known::Rfc3339, OffsetDateTime};
|
||||
@ -34,6 +35,22 @@ async fn update_primary_key() {
|
||||
assert_eq!(response.as_object().unwrap().len(), 4);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn create_and_update_with_different_encoding() {
|
||||
let server = Server::new().await;
|
||||
let index = server.index_with_encoder("test", Encoder::Gzip);
|
||||
let (_, code) = index.create(None).await;
|
||||
|
||||
assert_eq!(code, 202);
|
||||
|
||||
let index = server.index_with_encoder("test", Encoder::Brotli);
|
||||
index.update(Some("primary")).await;
|
||||
|
||||
let response = index.wait_task(1).await;
|
||||
|
||||
assert_eq!(response["status"], "succeeded");
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn update_nothing() {
|
||||
let server = Server::new().await;
|
||||
|
Reference in New Issue
Block a user