diff --git a/server/src/main.rs b/server/src/main.rs index ba04064..345c099 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -105,3 +105,24 @@ fn main() { .attach(Template::fairing()) .launch(); } + +// Integrating some basic tests just for this module +#[cfg(test)] +mod test { + use super::rocket; + use rocket::local::Client; + use rocket::http::Status; + + #[test] + fn homepage() { + // Just make sure that when request the home page we actually get the html back + let client = Client::new(rocket::ignite()).unwrap(); + let mut response = client.get("/").dispatch(); + assert_eq!(response.status(), Status::Ok); + } + // Next we test the static resource routes + fn static_css() { + let client = Client::new(rocket::ignite()).unwrap(); + let mut response = client.get("/css/index.css").dispatch(); + } +}