1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

update tests

This commit is contained in:
Nikolay Kim 2019-03-03 01:12:06 -08:00
parent a8f3dec527
commit f90ca868ca
2 changed files with 4 additions and 7 deletions

View File

@ -1022,8 +1022,7 @@ mod tests {
let mut rt = actix_rt::Runtime::new().unwrap();
let mut req = TestRequest::with_header(header::CONTENT_LENGTH, "11")
.set_payload(Bytes::from_static(b"hello=world"))
.finish()
.into();
.to_from();
let s = rt.block_on(Bytes::from_request(&mut req)).unwrap();
assert_eq!(s, Bytes::from_static(b"hello=world"));
@ -1034,8 +1033,7 @@ mod tests {
let mut rt = actix_rt::Runtime::new().unwrap();
let mut req = TestRequest::with_header(header::CONTENT_LENGTH, "11")
.set_payload(Bytes::from_static(b"hello=world"))
.finish()
.into();
.to_from();
let s = rt.block_on(String::from_request(&mut req)).unwrap();
assert_eq!(s, "hello=world");
@ -1050,8 +1048,7 @@ mod tests {
)
.header(header::CONTENT_LENGTH, "11")
.set_payload(Bytes::from_static(b"hello=world"))
.finish()
.into();
.to_from();
let s = rt.block_on(Form::<Info>::from_request(&mut req)).unwrap();
assert_eq!(s.hello, "world");

View File

@ -311,7 +311,7 @@ mod tests {
#[test]
fn test_preds() {
let r = TestRequest::default().method(Method::TRACE).request();
let r = TestRequest::default().method(Method::TRACE).to_request();
assert!(Not(Get()).check(&r,));
assert!(!Not(Trace()).check(&r,));