1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-01-18 13:51:50 +01: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);
}
#[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]
fn test_wserror_http_response() {
let resp: HttpResponse = WsHandshakeError::GetMethodRequired.error_response();