Refactor test suite to handle 303 See Other
This commit is contained in:
@@ -297,9 +297,11 @@ async fn configure_database(config: &DatabaseSettings) -> PgPool {
|
||||
}
|
||||
|
||||
pub fn assert_is_redirect_to(response: &reqwest::Response, location: &str) {
|
||||
dbg!(&response);
|
||||
assert_eq!(response.status().as_u16(), 200);
|
||||
assert_eq!(response.headers().get("hx-redirect").unwrap(), location);
|
||||
assert!(
|
||||
response.status().as_u16() == 303
|
||||
|| response.status().as_u16() == 200
|
||||
&& response.headers().get("hx-redirect").unwrap() == location
|
||||
);
|
||||
}
|
||||
|
||||
pub fn when_sending_an_email() -> MockBuilder {
|
||||
|
||||
Reference in New Issue
Block a user