From 1e44bc1a8f2634e4b60b886dbb3d35abe55e0df8 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 1 Feb 2022 19:16:47 +0100 Subject: [PATCH] Add test if resources are available --- tests/resources.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/resources.rs diff --git a/tests/resources.rs b/tests/resources.rs new file mode 100644 index 0000000..9765f3c --- /dev/null +++ b/tests/resources.rs @@ -0,0 +1,31 @@ +mod util; + +#[actix_rt::test] +async fn favicon() { + let test_app = util::spawn_app().await; + + let client = awc::Client::default(); + + let response = client + .get(&format!("{}/favicon.ico", test_app.address)) + .send() + .await + .expect("Failed to execute request"); + + assert!(response.status().is_success()); +} + +#[actix_rt::test] +async fn tacit_css() { + let test_app = util::spawn_app().await; + + let client = awc::Client::default(); + + let response = client + .get(&format!("{}/tacit-css.min.css", test_app.address)) + .send() + .await + .expect("Failed to execute request"); + + assert!(response.status().is_success()); +}