add unit tests

This commit is contained in:
2023-04-26 16:54:53 +02:00
parent 9236113507
commit 346a9b1d91
8 changed files with 325 additions and 135 deletions

View File

@ -4,7 +4,7 @@ use sqlx::SqlitePool;
#[derive(Serialize, Clone)]
pub struct PlannedEvent {
id: i64,
pub id: i64,
name: String,
planned_amount_cox: i64,
allow_guests: bool,
@ -47,6 +47,7 @@ WHERE planned_event.id like ?
.await
.ok()
}
pub async fn get_for_day(db: &SqlitePool, day: NaiveDate) -> Vec<PlannedEventWithUser> {
let day = format!("{day}");
let events = sqlx::query_as!(