more tests for jjs and more robust macro
This commit is contained in:
parent
2bb9771cd3
commit
a4f9a82477
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user