1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 18:44:35 +01:00
actix-web/tests/test_macro.rs

18 lines
466 B
Rust
Raw Normal View History

2019-03-17 21:55:03 +01:00
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());
}