mirror of
https://github.com/actix/actix-website
synced 2025-02-17 10:13:31 +01:00
Update first testing example
The example provided does not compile, this change allows it to.
This commit is contained in:
parent
90165ac1cc
commit
561f3b7647
@ -31,12 +31,12 @@ fn index(req: &HttpRequest) -> HttpResponse {
|
||||
|
||||
fn main() {
|
||||
let resp = test::TestRequest::with_header("content-type", "text/plain")
|
||||
.run(index)
|
||||
.run(&index)
|
||||
.unwrap();
|
||||
assert_eq!(resp.status(), http::StatusCode::OK);
|
||||
|
||||
let resp = test::TestRequest::default()
|
||||
.run(index)
|
||||
.run(&index)
|
||||
.unwrap();
|
||||
assert_eq!(resp.status(), http::StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user