mirror of https://github.com/fafhrd91/actix-web
fixed a test - that should be able to pass
This commit is contained in:
parent
45035e825a
commit
d6a09f0bed
|
@ -1,4 +1,6 @@
|
||||||
use actix_web_codegen::*;
|
use actix_web_codegen::*;
|
||||||
|
use actix_web::http::Method;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[route("/", method="UNEXPECTED")]
|
#[route("/", method="UNEXPECTED")]
|
||||||
async fn index() -> String {
|
async fn index() -> String {
|
||||||
|
@ -11,7 +13,7 @@ async fn main() {
|
||||||
|
|
||||||
let srv = actix_test::start(|| App::new().service(index));
|
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();
|
let response = request.send().await.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue