From 20ebdbd0e2e802a89f7671d76e37161c02d050ab Mon Sep 17 00:00:00 2001 From: Zeke Fast Date: Mon, 8 Sep 2025 11:41:44 +0200 Subject: [PATCH] Move case for "GET /about" (privacy_policy_is_visible) of hagrid::web::tests::basics() test to hagrid::routes::about::tests::get_about module. --- src/routes/about.rs | 21 +++++++++++++++++++++ src/web/mod.rs | 6 ------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/routes/about.rs b/src/routes/about.rs index a77c6b4..d967da3 100644 --- a/src/routes/about.rs +++ b/src/routes/about.rs @@ -60,5 +60,26 @@ mod tests { // TODO check translation assert!(response.into_string().unwrap().contains("Hagrid")); } + + #[rstest] + #[case::privacy_policy_is_visible( + "/about", + Status::Ok, + ContentType::HTML, + "distribution and discovery" + )] + fn basics( + #[from(client)] (_tmpdir, client): (TempDir, Client), + #[case] uri: &str, + #[case] status: Status, + #[case] content_type: ContentType, + #[case] page_text: &'static str, + ) { + let response = client.get(uri).dispatch(); + + assert_eq!(response.status(), status); + assert_eq!(response.content_type(), Some(content_type)); + assert!(response.into_string().unwrap().contains(page_text)); + } } } diff --git a/src/web/mod.rs b/src/web/mod.rs index c56a709..052084c 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -969,12 +969,6 @@ pub mod tests { } #[rstest] - #[case::privacy_policy_is_visible( - "/about", - Status::Ok, - ContentType::HTML, - "distribution and discovery" - )] #[case::privacy_policy_is_visible( "/about/privacy", Status::Ok,