Merge branch 'master' of gitlab.com:shockrah/freechat

This commit is contained in:
shockrah 2019-12-08 21:28:45 -08:00
commit a40321962f

View File

@ -56,7 +56,11 @@ mod test {
($client:expr, $file:expr) => { ($client:expr, $file:expr) => {
let response = $client.get($file).dispatch(); let response = $client.get($file).dispatch();
assert_eq!(response.status(), Status::Ok); assert_eq!(response.status(), Status::Ok);
} };
($client:expr, $file:expr, $code:expr) => {
let response = $client.get($file).dispatch();
assert_eq!(response.status(), $code);
};
} }
#[test] #[test]
fn pageroutes_get() { fn pageroutes_get() {
@ -73,9 +77,16 @@ mod test {
check_get!(client, "/static/css/about.css"); check_get!(client, "/static/css/about.css");
} }
// this one is meant to fail for now because we don't have any js to serve
#[test] #[test]
fn static_media_get() { fn static_media_get() {
let client = Client::new(rocket()).expect("Valid rocket instance"); let client = Client::new(rocket()).expect("Valid rocket instance");
check_get!(client, "/static/media/favicon.png"); check_get!(client, "/static/media/favicon.png");
} }
#[test]
fn static_js_get() {
let client = Client::new(rocket()).expect("Valid rocket instance");
check_get!(client, "/static/js/jquery.js", Status::NotFound);
}
} }