fixed a test - that should be able to pass

This commit is contained in:
edgerunnergit 2023-01-31 08:14:41 +05:30
parent 45035e825a
commit d6a09f0bed
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
use actix_web_codegen::*;
use actix_web::http::Method;
use std::str::FromStr;
#[route("/", method="UNEXPECTED")]
async fn index() -> String {
@ -11,7 +13,7 @@ async fn main() {
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/");
let request = srv.request(Method::from_str("UNEXPECTED").unwrap(), srv.url("/"));
let response = request.send().await.unwrap();
assert!(response.status().is_success());
}