From 561f3b76475a06ee99d3769f23337f5180c14e85 Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Sat, 4 Aug 2018 19:20:32 +0100 Subject: [PATCH] Update first testing example The example provided does not compile, this change allows it to. --- content/docs/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/testing.md b/content/docs/testing.md index 46e5249..cd2acf1 100644 --- a/content/docs/testing.md +++ b/content/docs/testing.md @@ -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); }