mirror of https://github.com/fafhrd91/actix-web
Scope: Fix tests
This commit is contained in:
parent
08ce463297
commit
db61807acc
24
src/scope.rs
24
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue