1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

Merge branch 'master' of github.com:actix/examples

This commit is contained in:
Nikolay Kim 2019-04-07 23:39:59 -07:00
commit 764ac94a07

View File

@ -39,8 +39,8 @@ mod test {
fn test() { fn test() {
let mut srv = TestServer::new(|| HttpService::new(App::new().service(index))); let mut srv = TestServer::new(|| HttpService::new(App::new().service(index)));
let req = srv.get(); let req = srv.get("/");
let response = srv.block_on(req.send()).unwrap(); let mut response = srv.block_on(req.send()).unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
assert_eq!( assert_eq!(
@ -67,8 +67,8 @@ mod test {
) )
); );
let req = srv.get().uri(srv.url("/?name=foo&lastname=bar")); let req = srv.get("/?name=foo&lastname=bar");
let response = srv.block_on(req.send()).unwrap(); let mut response = srv.block_on(req.send()).unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
assert_eq!( assert_eq!(
@ -90,12 +90,12 @@ mod test {
) )
); );
let req = srv.get().uri(srv.url("/?name=foo")); let req = srv.get("/?name=foo");
let response = srv.block_on(req.send()).unwrap(); let mut response = srv.block_on(req.send()).unwrap();
assert!(response.status().is_server_error()); assert!(response.status().is_server_error());
let req = srv.get().uri(srv.url("/?lastname=bar")); let req = srv.get("/?lastname=bar");
let response = srv.block_on(req.send()).unwrap(); let mut response = srv.block_on(req.send()).unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
assert_eq!( assert_eq!(