#[macro_use] extern crate json; #[macro_use] extern crate noir; #[macro_use] mod base_test; test!(); // Response Status ------------------------------------------------------------ #[test] fn test_get_with_expected_status() { let actual = { API::get("/status/500") .expected_status(StatusCode::InternalServerError).collect() }; assert_pass!(actual); } #[test] fn test_get_with_expected_status_mismatch() { let actual = { API::get("/status/404") .expected_status(StatusCode::Ok).collect() }; assert_fail!(r#"
Response Failure: GET request to \"http://localhost:4000/status/404\" returned
1 error(s)
1) Response status code does not match value, expected: \"200 OK\" but got: \"
404 Not Found\" "#, actual); }