mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 19:45:05 +08:00
05f93541d8
Fixes the following error: cargo test --no-default-features ... error: couldn't read target/debug/build/meilisearch-http-ec029d8c902cf2cb/out/generated.rs: No such file or directory (os error 2) --> meilisearch-http/tests/dashboard/mod.rs:8:9 | 8 | include!(concat!(env!("OUT_DIR"), "/generated.rs")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info) error: could not compile `meilisearch-http` due to previous error
26 lines
622 B
Rust
26 lines
622 B
Rust
use crate::common::Server;
|
|
|
|
#[cfg(feature = "mini-dashboard")]
|
|
#[actix_rt::test]
|
|
async fn dashboard_assets_load() {
|
|
let server = Server::new().await;
|
|
|
|
mod generated {
|
|
include!(concat!(env!("OUT_DIR"), "/generated.rs"));
|
|
}
|
|
|
|
let generated = generated::generate();
|
|
|
|
for (path, _) in generated.into_iter() {
|
|
let path = if path == "index.html" {
|
|
// "index.html" redirects to "/"
|
|
"/".to_owned()
|
|
} else {
|
|
"/".to_owned() + path
|
|
};
|
|
|
|
let (_, status_code) = server.service.get(&path).await;
|
|
assert_eq!(status_code, 200);
|
|
}
|
|
}
|