Skip to main content

assert_has_header

Function assert_has_header 

Source
pub fn assert_has_header(response: &Response, header_name: &str)
Expand description

Assert response has header

Panics if the header is not present.

§Examples

use reinhardt_testkit::http::{create_test_response, assert_has_header};

let response = create_test_response().with_header("x-api-version", "v1");
assert_has_header(&response, "x-api-version"); // Passes
use reinhardt_testkit::http::{create_test_response, assert_has_header};

let response = create_test_response();
assert_has_header(&response, "x-missing-header"); // Panics