From a07ea00cc4811466a09b8afda7b88e4bc115e663 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 17 Mar 2019 13:55:03 -0700 Subject: [PATCH] add basic test for proc macro --- tests/test_macro.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/test_macro.rs diff --git a/tests/test_macro.rs b/tests/test_macro.rs new file mode 100644 index 000000000..62b5d618f --- /dev/null +++ b/tests/test_macro.rs @@ -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()); +}