From 9ea0781aba57a6cc1d29313d4d71db6be35e5ead Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 6 Dec 2017 16:58:49 -0800 Subject: [PATCH] fix test --- src/httprequest.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/httprequest.rs b/src/httprequest.rs index f4b052a7..807059b1 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -544,15 +544,14 @@ mod tests { let mut map = HashMap::new(); map.insert("/user/{name}.{ext}".to_owned(), resource); let router = Router::new("", map); + assert!(router.has_route("/user/test.html")); + assert!(!router.has_route("/test/unknown")); assert_eq!(req.url_for("unknown", &["test"]), Err(UrlGenerationError::RouterNotAvailable)); 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"]),