1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 07:36:43 +00:00

add basic test for proc macro

This commit is contained in:
Nikolay Kim 2019-03-17 13:55:03 -07:00
parent 6b66681827
commit a07ea00cc4

17
tests/test_macro.rs Normal file
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());
}