1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

update cargo files

This commit is contained in:
Nikolay Kim
2019-03-26 12:50:51 -07:00
parent 50c0ddb3cd
commit 9451ba71f4
10 changed files with 48 additions and 41 deletions

View File

@ -1,6 +1,6 @@
use actix_http::HttpService;
use actix_http_test::TestServer;
use actix_web::{get, App, HttpResponse, Responder};
use actix_web::{get, http, App, HttpResponse, Responder};
#[get("/test")]
fn test() -> impl Responder {
@ -11,7 +11,7 @@ fn test() -> impl Responder {
fn test_body() {
let mut srv = TestServer::new(|| HttpService::new(App::new().service(test)));
let request = srv.get().uri(srv.url("/test")).finish().unwrap();
let response = srv.send_request(request).unwrap();
let request = srv.request(http::Method::GET, srv.url("/test"));
let response = srv.block_on(request.send()).unwrap();
assert!(response.status().is_success());
}