1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-20 08:31:09 +00:00

expect error tests

This commit is contained in:
Nikolay Kim 2017-11-19 18:02:31 -10:00
parent 1a0e87ac3c
commit c44e4ad100

View file

@ -393,6 +393,14 @@ mod tests {
assert_eq!(e, HttpRangeError::NoOverlap); assert_eq!(e, HttpRangeError::NoOverlap);
} }
#[test]
fn test_expect_error() {
let resp: HttpResponse = ExpectError::Encoding.error_response();
assert_eq!(resp.status(), StatusCode::EXPECTATION_FAILED);
let resp: HttpResponse = ExpectError::UnknownExpect.error_response();
assert_eq!(resp.status(), StatusCode::EXPECTATION_FAILED);
}
#[test] #[test]
fn test_wserror_http_response() { fn test_wserror_http_response() {
let resp: HttpResponse = WsHandshakeError::GetMethodRequired.error_response(); let resp: HttpResponse = WsHandshakeError::GetMethodRequired.error_response();