[#13] added some more unit tests, hated life for a bit

This commit is contained in:
Jef Roosens 2021-04-08 22:53:29 +02:00
parent 2e73d88ae9
commit e4b8be3ba3
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
4 changed files with 32 additions and 2 deletions

View file

@ -1,3 +1,4 @@
/// In here, any non-unit tests are placed.
use rocket::http::Status;
use rocket::local::Client;
@ -12,9 +13,11 @@ fn test_404_response() {
let response = client.get("/").dispatch();
assert_eq!(response.status(), Status::NotFound);
// TODO add text check as well
}
/// Test 404 on invalid parameters
// TODO make this check a 400 instead
#[test]
fn test_invalid_parameters() {
let client = Client::new(rocket()).expect("valid rocket instance");