Skip to main content

assert_status

Function assert_status 

Source
pub fn assert_status(response: &Response, expected: StatusCode)
Expand description

Assert that response has expected status code

This is a unified function combining assert_status() from micro and assert_response_status() from views.

§Examples

use reinhardt_testkit::assertions::assert_status;
use reinhardt_http::Response;
use http::StatusCode;

let response = Response::ok();
assert_status(&response, StatusCode::OK);

§Panics

Panics if status codes don’t match.