mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 08:22:59 +01:00
more tests
This commit is contained in:
parent
4b03d03404
commit
2a0d5db41a
@ -258,4 +258,21 @@ mod tests {
|
|||||||
let resp = app.run(req).msg().unwrap();
|
let resp = app.run(req).msg().unwrap();
|
||||||
assert_eq!(resp.status(), StatusCode::METHOD_NOT_ALLOWED);
|
assert_eq!(resp.status(), StatusCode::METHOD_NOT_ALLOWED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_unhandled_prefix() {
|
||||||
|
let app = Application::new("/test")
|
||||||
|
.resource("/test", |r| r.h(httpcodes::HTTPOk))
|
||||||
|
.finish();
|
||||||
|
assert!(app.handle(HttpRequest::default()).is_err());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_state() {
|
||||||
|
let app = Application::with_state("/", 10)
|
||||||
|
.resource("/", |r| r.h(httpcodes::HTTPOk))
|
||||||
|
.finish();
|
||||||
|
assert_eq!(
|
||||||
|
app.run(HttpRequest::default()).msg().unwrap().status(), StatusCode::OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user