Fix the tests to work in all cases (I hope!)

This commit is contained in:
Omid Rad 2021-08-31 08:58:47 +02:00
parent 50cc3b5e1f
commit 8b89bb2069
1 changed files with 2 additions and 3 deletions

View File

@ -399,11 +399,10 @@ mod tests {
.service(web::resource("/test").route(web::to(test)))
});
let client = ClientBuilder::new().finish();
let res = client.post(srv.url("/")).send_body("Hello").await.unwrap();
let res = srv.post("/").send_body("Hello").await.unwrap();
assert_eq!(res.status().as_u16(), 200);
let res = client.head(srv.url("/")).send().await.unwrap();
let res = srv.post("/").send().await.unwrap();
assert_eq!(res.status().as_u16(), 200);
}