make scheckbuch user behave as previously, but in own file
This commit is contained in:
@ -256,7 +256,7 @@ mod test {
|
||||
let trip_details = TripDetails::find_by_id(&pool, tripdetails_id)
|
||||
.await
|
||||
.unwrap();
|
||||
let user = EventUser::new(&pool, User::find_by_id(&pool, 1).await.unwrap())
|
||||
let user = EventUser::new(&pool, &User::find_by_id(&pool, 1).await.unwrap())
|
||||
.await
|
||||
.unwrap();
|
||||
Event::create(&pool, &user, "new-event".into(), 2, false, &trip_details).await;
|
||||
@ -269,7 +269,7 @@ mod test {
|
||||
UserTrip::create(&pool, &rower, &trip_details, None)
|
||||
.await
|
||||
.unwrap();
|
||||
let cox = SteeringUser::new(&pool, User::find_by_name(&pool, "cox").await.unwrap())
|
||||
let cox = SteeringUser::new(&pool, &User::find_by_name(&pool, "cox").await.unwrap())
|
||||
.await
|
||||
.unwrap();
|
||||
Trip::new_join(&pool, &cox, &event).await.unwrap();
|
||||
@ -284,7 +284,7 @@ mod test {
|
||||
is_locked: event.is_locked,
|
||||
trip_type_id: None,
|
||||
};
|
||||
event.update(&pool, &cancel_update).await;
|
||||
event.update(&pool, &user, &cancel_update).await;
|
||||
|
||||
// Rower received notification
|
||||
let notifications = Notification::for_user(&pool, &rower).await;
|
||||
@ -314,12 +314,12 @@ mod test {
|
||||
is_locked: event.is_locked,
|
||||
trip_type_id: None,
|
||||
};
|
||||
event.update(&pool, &update).await;
|
||||
event.update(&pool, &user, &update).await;
|
||||
assert!(Notification::for_user(&pool, &rower).await.is_empty());
|
||||
assert!(Notification::for_user(&pool, &cox.user).await.is_empty());
|
||||
|
||||
// Cancel event again
|
||||
event.update(&pool, &cancel_update).await;
|
||||
event.update(&pool, &user, &cancel_update).await;
|
||||
|
||||
// Rower is removed if notification is accepted
|
||||
assert!(event.is_rower_registered(&pool, &rower).await);
|
||||
|
Reference in New Issue
Block a user