1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-27 09:12:57 +01:00
This commit is contained in:
Rob Ede 2022-03-01 04:30:10 +00:00
parent 12f6db3755
commit e1f79dae17
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -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;