fix tests
This commit is contained in:
parent
ba3e8625f6
commit
88b870031e
1 changed files with 8 additions and 6 deletions
|
@ -438,9 +438,11 @@ mod test {
|
|||
// this function adds a user with the omega id, so the invite can be added
|
||||
let server = server_with_pool(&pool).await;
|
||||
|
||||
let invite =
|
||||
Invitation::new(Julid::omega()).with_expires_in(Duration::from_millis(1));
|
||||
let invite = invite.commit(&pool).await.unwrap();
|
||||
let invite = Invitation::new(Julid::omega())
|
||||
.with_expires_in(Duration::from_millis(1))
|
||||
.commit(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
std::thread::sleep(Duration::from_millis(100));
|
||||
|
||||
|
@ -611,7 +613,7 @@ mod test {
|
|||
.await;
|
||||
|
||||
// no user in db
|
||||
let user = User::try_get("bad_user", &pool).await;
|
||||
let user = User::try_get("", &pool).await;
|
||||
assert!(user.is_ok() && user.unwrap().is_none());
|
||||
|
||||
let body = std::str::from_utf8(resp.as_bytes()).unwrap();
|
||||
|
@ -640,7 +642,7 @@ mod test {
|
|||
.await;
|
||||
|
||||
// no user in db
|
||||
let user = User::try_get("bad_user", &pool).await;
|
||||
let user = User::try_get("bad_user12345678901234567890", &pool).await;
|
||||
assert!(user.is_ok() && user.unwrap().is_none());
|
||||
|
||||
let body = std::str::from_utf8(resp.as_bytes()).unwrap();
|
||||
|
@ -669,7 +671,7 @@ mod test {
|
|||
|
||||
// get the new user from the db
|
||||
let user = User::try_get("good_user", &pool).await;
|
||||
assert!(user.is_ok());
|
||||
assert!(user.unwrap().is_some());
|
||||
|
||||
// now try again
|
||||
let resp = server
|
||||
|
|
Loading…
Reference in a new issue