add rest test

This commit is contained in:
philipp 2023-04-10 14:39:41 +02:00
parent cf0d73e541
commit 54211c72a9

View File

@ -88,27 +88,27 @@ pub fn start(db: SqlitePool) -> Rocket<Build> {
.attach(Template::fairing()) .attach(Template::fairing())
} }
//#[cfg(test)] #[cfg(test)]
//mod test { mod test {
// use crate::testdb; use crate::testdb;
//
// use super::start; use super::start;
// use rocket::http::Status; use rocket::http::Status;
// use rocket::local::asynchronous::Client; use rocket::local::asynchronous::Client;
// use rocket::uri; use rocket::uri;
// use sqlx::SqlitePool; use sqlx::SqlitePool;
//
// #[sqlx::test] #[sqlx::test]
// fn test_not_logged_in() { fn test_not_logged_in() {
// let pool = testdb!(); let pool = testdb!();
//
// let client = Client::tracked(start(pool)) let client = Client::tracked(start(pool))
// .await .await
// .expect("valid rocket instance"); .expect("valid rocket instance");
// let response = client.get(uri!(super::index)).dispatch().await; let response = client.get(uri!(super::index)).dispatch().await;
//
// assert_eq!(response.status(), Status::SeeOther); assert_eq!(response.status(), Status::SeeOther);
// let location = response.headers().get("Location").next().unwrap(); let location = response.headers().get("Location").next().unwrap();
// assert_eq!(location, "/auth"); assert_eq!(location, "/auth");
// } }
//} }