From ba166cf2816546d6e7382c8c402ad6cce3360ae6 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 27 Nov 2019 23:43:55 -0800 Subject: [PATCH] tests are more specific at this point yes i think so --- server/src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 6eb89c1..e7319cb 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -59,18 +59,23 @@ mod test { } } #[test] - fn test_homepage() { + fn pageroutes_get() { // Just make sure that when request the home page we actually get the html back let client = Client::new(rocket()).expect("Valid rocket instance"); - let response = client.get("/").dispatch(); - assert_eq!(response.status(), Status::Ok); + check_get!(client, "/"); + check_get!(client, "/about"); } // Next we test the static resource routes #[test] - fn statics() { + fn static_css_get() { let client = Client::new(rocket()).expect("Valid rocket instance"); check_get!(client, "/static/index.css"); check_get!(client, "/static/css/about.css"); + } + + #[test] + fn static_media_get() { + let client = Client::new(rocket()).expect("Valid rocket instance"); check_get!(client, "/static/media/favicon.png"); } }