Compare commits
No commits in common. "c8cfcd619f7518f8b1f13e36d61235e9ea95743a" and "8e1b1c1aacb583ad2eacca1ee74579a2e54e3829" have entirely different histories.
c8cfcd619f
...
8e1b1c1aac
@ -463,13 +463,7 @@ WHERE trip_details.id=?
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::{
|
use crate::{model::tripdetails::TripDetails, testdb};
|
||||||
model::{
|
|
||||||
tripdetails::TripDetails,
|
|
||||||
user::{EventUser, User},
|
|
||||||
},
|
|
||||||
testdb,
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::Event;
|
use super::Event;
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
@ -489,10 +483,7 @@ mod test {
|
|||||||
|
|
||||||
let trip_details = TripDetails::find_by_id(&pool, 1).await.unwrap();
|
let trip_details = TripDetails::find_by_id(&pool, 1).await.unwrap();
|
||||||
|
|
||||||
let admin = EventUser::new(&pool, User::find_by_id(&pool, 1).await.unwrap())
|
Event::create(&pool, "new-event".into(), 2, false, &trip_details).await;
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
Event::create(&pool, &admin, "new-event".into(), 2, false, &trip_details).await;
|
|
||||||
|
|
||||||
let res = Event::get_for_day(&pool, Local::now().date_naive()).await;
|
let res = Event::get_for_day(&pool, Local::now().date_naive()).await;
|
||||||
assert_eq!(res.len(), 2);
|
assert_eq!(res.len(), 2);
|
||||||
|
@ -221,7 +221,7 @@ mod test {
|
|||||||
notification::Notification,
|
notification::Notification,
|
||||||
trip::Trip,
|
trip::Trip,
|
||||||
tripdetails::{TripDetails, TripDetailsToAdd},
|
tripdetails::{TripDetails, TripDetailsToAdd},
|
||||||
user::{EventUser, SteeringUser, User},
|
user::{SteeringUser, User},
|
||||||
usertrip::UserTrip,
|
usertrip::UserTrip,
|
||||||
},
|
},
|
||||||
testdb,
|
testdb,
|
||||||
@ -247,10 +247,7 @@ mod test {
|
|||||||
let trip_details = TripDetails::find_by_id(&pool, tripdetails_id)
|
let trip_details = TripDetails::find_by_id(&pool, tripdetails_id)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let user = EventUser::new(&pool, User::find_by_id(&pool, 1).await.unwrap())
|
Event::create(&pool, "new-event".into(), 2, false, &trip_details).await;
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
Event::create(&pool, &user, "new-event".into(), 2, false, &trip_details).await;
|
|
||||||
let event = Event::find_by_trip_details(&pool, trip_details.id)
|
let event = Event::find_by_trip_details(&pool, trip_details.id)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user