mirror of
https://github.com/actix/actix-web.git
synced 2024-11-18 23:51:14 +00:00
fix test
This commit is contained in:
parent
63502fa833
commit
9ea0781aba
1 changed files with 2 additions and 3 deletions
|
@ -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"]),
|
||||
|
|
Loading…
Reference in a new issue