mirror of https://github.com/fafhrd91/actix-web
Add test for handlers returning unit.
This commit is contained in:
parent
6a23d82dce
commit
9026679cb7
|
@ -824,6 +824,16 @@ mod tests {
|
||||||
assert_eq!(resp.as_msg().status(), StatusCode::NOT_FOUND);
|
assert_eq!(resp.as_msg().status(), StatusCode::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_unit_responser() {
|
||||||
|
let app = App::new().resource("/unit", |r| r.f(|_| {})).finish();
|
||||||
|
|
||||||
|
let req = TestRequest::with_uri("/unit").request();
|
||||||
|
let resp = app.run(req);
|
||||||
|
assert_eq!(resp.as_msg().status(), StatusCode::OK);
|
||||||
|
assert_eq!(resp.as_msg().body(), &Body::Empty);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_option_responder() {
|
fn test_option_responder() {
|
||||||
let app = App::new()
|
let app = App::new()
|
||||||
|
|
Loading…
Reference in New Issue