mirror of
https://github.com/actix/actix-website
synced 2025-01-23 00:25:55 +01:00
Merge pull request #39 from shakyShane/patch-1
Update first testing example
This commit is contained in:
commit
f420916025
@ -31,12 +31,12 @@ fn index(req: &HttpRequest) -> HttpResponse {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let resp = test::TestRequest::with_header("content-type", "text/plain")
|
let resp = test::TestRequest::with_header("content-type", "text/plain")
|
||||||
.run(index)
|
.run(&index)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(resp.status(), http::StatusCode::OK);
|
assert_eq!(resp.status(), http::StatusCode::OK);
|
||||||
|
|
||||||
let resp = test::TestRequest::default()
|
let resp = test::TestRequest::default()
|
||||||
.run(index)
|
.run(&index)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(resp.status(), http::StatusCode::BAD_REQUEST);
|
assert_eq!(resp.status(), http::StatusCode::BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user