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:
commit
764ac94a07
@ -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!(
|
||||||
|
Loading…
Reference in New Issue
Block a user