mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 18:45:41 +00:00
feat: def get_email trait
This commit is contained in:
@@ -65,6 +65,17 @@ pub async fn database_works<'a, T: MCDatabase>(
|
||||
assert_eq!(name_hash.hash, p.hash, "user password matches");
|
||||
assert_eq!(name_hash.username, p.username, "username matches");
|
||||
|
||||
// testing get_email
|
||||
assert_eq!(
|
||||
db.get_email(p.username)
|
||||
.await
|
||||
.unwrap()
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.as_str(),
|
||||
p.email.unwrap()
|
||||
);
|
||||
|
||||
// testing email exists
|
||||
assert!(
|
||||
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
|
||||
@@ -119,6 +130,9 @@ pub async fn database_works<'a, T: MCDatabase>(
|
||||
"user registration with email is deleted; so email shouldn't exsit"
|
||||
);
|
||||
|
||||
// testing get_email = None
|
||||
assert_eq!(db.get_email(p.username).await.unwrap(), None);
|
||||
|
||||
// testing update email
|
||||
let update_email = UpdateEmail {
|
||||
username: p.username,
|
||||
|
||||
Reference in New Issue
Block a user