This commit is contained in:
philipp 2023-10-24 14:58:32 +02:00
parent 816425c158
commit 6d7ef2e836

View File

@ -24,28 +24,6 @@ mod test {
use crate::testdb;
#[sqlx::test]
fn test_faq() {
let db = testdb!();
let rocket = rocket::build().manage(db.clone());
let rocket = crate::tera::config(rocket);
let client = Client::tracked(rocket).await.unwrap();
let login = client
.post("/auth")
.header(ContentType::Form) // Set the content type to form
.body("name=cox&password=cox"); // Add the form data to the request body;
login.dispatch().await;
let req = client.get("/faq");
let response = req.dispatch().await;
assert_eq!(response.status(), Status::Ok);
assert!(response.into_string().await.unwrap().contains("FAQs"));
}
#[sqlx::test]
fn test_without_login() {
let db = testdb!();