mirror of
https://github.com/fafhrd91/actix-web
synced 2024-12-01 02:54:36 +01:00
test for Router::has_route
This commit is contained in:
parent
a18bd5dac0
commit
63502fa833
@ -550,6 +550,9 @@ mod tests {
|
|||||||
|
|
||||||
let mut req = req.with_state(Rc::new(()), router);
|
let mut req = req.with_state(Rc::new(()), router);
|
||||||
|
|
||||||
|
assert_eq!(req.router().unwrap().has_route("index"));
|
||||||
|
assert_eq!(!req.router().unwrap().has_route("unknown"));
|
||||||
|
|
||||||
assert_eq!(req.url_for("unknown", &["test"]),
|
assert_eq!(req.url_for("unknown", &["test"]),
|
||||||
Err(UrlGenerationError::ResourceNotFound));
|
Err(UrlGenerationError::ResourceNotFound));
|
||||||
assert_eq!(req.url_for("index", &["test"]),
|
assert_eq!(req.url_for("index", &["test"]),
|
||||||
|
Loading…
Reference in New Issue
Block a user