From 63502fa833c66267d786f9a67f63da1d6dd1c0da Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 6 Dec 2017 16:40:23 -0800 Subject: [PATCH] test for Router::has_route --- src/httprequest.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/httprequest.rs b/src/httprequest.rs index 07ae8b4e1..f4b052a73 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -550,6 +550,9 @@ mod tests { 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"]), Err(UrlGenerationError::ResourceNotFound)); assert_eq!(req.url_for("index", &["test"]),