mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-05 16:12:44 +02:00
Move case for "GET /" (landing_page_is_visible) of hagrid::web::tests::basics() test to hagrid::routes::index::tests::get_root module.
This commit is contained in:
committed by
Vincent Breitmoser
parent
74c25c9d9b
commit
090a6f222a
@@ -6,3 +6,32 @@ use rocket_i18n::I18n;
|
||||
pub fn root(origin: RequestOrigin, i18n: I18n) -> MyResponse {
|
||||
MyResponse::ok_bare("index", i18n, origin)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::web::tests::common::*;
|
||||
use ::rocket::http::{ContentType, Status};
|
||||
use ::rocket::local::blocking::Client;
|
||||
use rstest::rstest;
|
||||
use tempfile::TempDir;
|
||||
|
||||
mod get_root {
|
||||
use super::*;
|
||||
|
||||
#[rstest]
|
||||
#[case::landing_page_is_visible("/", Status::Ok, ContentType::HTML, "Hagrid")]
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -969,7 +969,6 @@ pub mod tests {
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case::landing_page_is_visible("/", Status::Ok, ContentType::HTML, "Hagrid")]
|
||||
#[case::privacy_policy_is_visible(
|
||||
"/about",
|
||||
Status::Ok,
|
||||
|
Reference in New Issue
Block a user