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

move macros tests to codegen crate

This commit is contained in:
Nikolay Kim
2019-03-17 20:20:10 -07:00
parent a07ea00cc4
commit 88152740c6
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,17 @@
use actix_http::HttpService;
use actix_http_test::TestServer;
use actix_web::{get, App, HttpResponse, Responder};
#[get("/test")]
fn test() -> impl Responder {
HttpResponse::Ok()
}
#[test]
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();
assert!(response.status().is_success());
}