pagetop/tests/service.rs
Manuel Cillero 8aa4372bdf ♻️ Convierte initialize() y Application en async
`async_trait` se re-exporta desde `pagetop` y se añade al preludio; ya
no es necesario declararlo como dependencia en las extensiones.
`initialize()` es ahora verdaderamente `async` (con `.await`), y
`Application::new()` y `prepare()` pasan también a ser funciones
`async`.
2026-07-04 22:56:19 +02:00

12 lines
382 B
Rust

use pagetop::prelude::*;
#[pagetop::test]
async fn homepage_returns_404() {
let app = web::test::init_router(Application::new().await.test());
let req = web::test::TestRequest::get().uri("/").to_request();
let resp = web::test::send_request(&app, req).await;
// Comprueba el acceso a la ruta de inicio.
assert_eq!(resp.status(), web::http::StatusCode::OK);
}