actix-http: fix test to work without cookies features

The feature used to be implicity enabled by actix-http-test, but that
changed in the previous commit
This commit is contained in:
Alexandre Rebert 2021-02-20 21:31:34 -05:00
parent 54c92f0f0f
commit cba8292780
No known key found for this signature in database
GPG Key ID: 7E0273BEEB243174
2 changed files with 7 additions and 2 deletions

View File

@ -983,6 +983,7 @@ mod tests {
assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR); assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR);
} }
#[cfg(feature = "cookies")]
#[test] #[test]
fn test_cookie_parse() { fn test_cookie_parse() {
let resp: Response = CookieParseError::EmptyName.error_response(); let resp: Response = CookieParseError::EmptyName.error_response();

View File

@ -896,8 +896,9 @@ mod tests {
use super::*; use super::*;
use crate::body::Body; use crate::body::Body;
use crate::http::header::{HeaderValue, CONTENT_TYPE, COOKIE, SET_COOKIE}; use crate::http::header::{HeaderValue, CONTENT_TYPE, COOKIE};
use crate::HttpMessage; #[cfg(feature = "cookies")]
use crate::{http::header::SET_COOKIE, HttpMessage};
#[test] #[test]
fn test_debug() { fn test_debug() {
@ -909,6 +910,7 @@ mod tests {
assert!(dbg.contains("Response")); assert!(dbg.contains("Response"));
} }
#[cfg(feature = "cookies")]
#[test] #[test]
fn test_response_cookies() { fn test_response_cookies() {
let req = crate::test::TestRequest::default() let req = crate::test::TestRequest::default()
@ -946,6 +948,7 @@ mod tests {
); );
} }
#[cfg(feature = "cookies")]
#[test] #[test]
fn test_update_response_cookies() { fn test_update_response_cookies() {
let mut r = Response::Ok() let mut r = Response::Ok()
@ -1097,6 +1100,7 @@ mod tests {
assert_eq!(resp.body().get_ref(), b"test"); assert_eq!(resp.body().get_ref(), b"test");
} }
#[cfg(feature = "cookies")]
#[test] #[test]
fn test_into_builder() { fn test_into_builder() {
let mut resp: Response = "test".into(); let mut resp: Response = "test".into();