From db61807acc309cba714f5fe801b9c0290fcae397 Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Fri, 31 May 2019 18:24:46 +0200 Subject: [PATCH] Scope: Fix tests --- src/scope.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index 254ce551c..b7701b7b0 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -1085,8 +1085,8 @@ mod tests { let mut srv = init_service( App::new().service( web::scope("/app") - .configure(||{ - + .configure(|s|{ + s.route("/path1", web::get().to(||HttpResponse::Ok())); }) ), ); @@ -1095,4 +1095,24 @@ mod tests { let resp = block_on(srv.call(req)).unwrap(); assert_eq!(resp.status(), StatusCode::OK); } + + #[test] + fn test_scope_config_2() { + let mut srv = init_service( + App::new().service( + web::scope("/app") + .configure(|s|{ + s.service( + web::scope("/v1") + .configure(|s|{ + s.route("/", web::get().to(||HttpResponse::Ok())); + })); + }) + ), + ); + + let req = TestRequest::with_uri("/app/v1/").to_request(); + let resp = block_on(srv.call(req)).unwrap(); + assert_eq!(resp.status(), StatusCode::OK); + } }