mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-27 09:12:57 +01:00
fix test
This commit is contained in:
parent
12f6db3755
commit
e1f79dae17
@ -358,7 +358,7 @@ mod tests {
|
|||||||
assert!(f.is_ok());
|
assert!(f.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_web::test]
|
||||||
async fn test_middleware_works_with_app() {
|
async fn test_middleware_works_with_app() {
|
||||||
async fn validator(
|
async fn validator(
|
||||||
_req: ServiceRequest,
|
_req: ServiceRequest,
|
||||||
@ -371,7 +371,7 @@ mod tests {
|
|||||||
let srv = actix_web::test::init_service(
|
let srv = actix_web::test::init_service(
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(middleware)
|
.wrap(middleware)
|
||||||
.route("/", web::get().to(|| web::HttpResponse::Ok())),
|
.route("/", web::get().to(HttpResponse::Ok)),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ mod tests {
|
|||||||
assert_eq!(resp.status(), StatusCode::UNAUTHORIZED);
|
assert_eq!(resp.status(), StatusCode::UNAUTHORIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_web::test]
|
||||||
async fn test_middleware_works_with_scope() {
|
async fn test_middleware_works_with_scope() {
|
||||||
async fn validator(
|
async fn validator(
|
||||||
_req: ServiceRequest,
|
_req: ServiceRequest,
|
||||||
@ -397,7 +397,7 @@ mod tests {
|
|||||||
App::new().service(
|
App::new().service(
|
||||||
web::scope("/")
|
web::scope("/")
|
||||||
.wrap(middleware)
|
.wrap(middleware)
|
||||||
.route("/", web::get().to(|| web::HttpResponse::Ok())),
|
.route("/", web::get().to(HttpResponse::Ok)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
Loading…
Reference in New Issue
Block a user