From f90ca868ca76f8e3d63475f3f661558f1e96330f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 3 Mar 2019 01:12:06 -0800 Subject: [PATCH] update tests --- src/extractor.rs | 9 +++------ src/filter.rs | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/extractor.rs b/src/extractor.rs index 24e4c8af..5fa9af61 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -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::::from_request(&mut req)).unwrap(); assert_eq!(s.hello, "world"); diff --git a/src/filter.rs b/src/filter.rs index 9b49c9dd..501c60d8 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -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,));