fix(docs): TestRequest example fixed

This commit is contained in:
Arpan Koirala 2022-02-10 12:42:19 +05:45
parent 1b706b3069
commit fc83b80da0
No known key found for this signature in database
GPG Key ID: A6BE6D0C7815AFFD
1 changed files with 3 additions and 3 deletions

View File

@ -43,14 +43,14 @@ use crate::cookie::{Cookie, CookieJar};
/// ///
/// #[actix_web::test] /// #[actix_web::test]
/// async fn test_index() { /// async fn test_index() {
/// let req = test::TestRequest::default().insert_header("content-type", "text/plain") /// let req = test::TestRequest::default().insert_header(("content-type", "text/plain"))
/// .to_http_request(); /// .to_http_request();
/// ///
/// let resp = index(req).await.unwrap(); /// let resp = index(req).await;
/// assert_eq!(resp.status(), StatusCode::OK); /// assert_eq!(resp.status(), StatusCode::OK);
/// ///
/// let req = test::TestRequest::default().to_http_request(); /// let req = test::TestRequest::default().to_http_request();
/// let resp = index(req).await.unwrap(); /// let resp = index(req).await;
/// assert_eq!(resp.status(), StatusCode::BAD_REQUEST); /// assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
/// } /// }
/// ``` /// ```