uniironically testing tests

This commit is contained in:
shockrahwow 2019-11-13 18:47:36 -08:00
parent c4e0071a59
commit 5aac2a0c10

View File

@ -105,3 +105,24 @@ fn main() {
.attach(Template::fairing()) .attach(Template::fairing())
.launch(); .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();
}
}