mirror of
https://github.com/actix/actix-web.git
synced 2024-12-19 14:49:01 +00:00
test woth with_params
This commit is contained in:
parent
88a81155bd
commit
02033724d8
1 changed files with 12 additions and 0 deletions
|
@ -75,3 +75,15 @@ fn test_request_query() {
|
||||||
assert_eq!(query[0].0.as_ref(), "id");
|
assert_eq!(query[0].0.as_ref(), "id");
|
||||||
assert_eq!(query[0].1.as_ref(), "test");
|
assert_eq!(query[0].1.as_ref(), "test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_request_params() {
|
||||||
|
let req = HttpRequest::new(Method::GET, Uri::try_from("/?id=test").unwrap(),
|
||||||
|
Version::HTTP_11, HeaderMap::new());
|
||||||
|
|
||||||
|
let mut params = Params::new();
|
||||||
|
params.insert("key".to_owned(), "value".to_owned());
|
||||||
|
|
||||||
|
let req = req.with_params(params);
|
||||||
|
assert_eq!(req.params().find("key"), Some("value"));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue