mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31:02 +00:00
fix test following ldap udpate
This commit is contained in:
parent
9ec2d93f50
commit
69bcb01715
1 changed files with 7 additions and 7 deletions
|
@ -1149,7 +1149,7 @@ pub(crate) mod tests {
|
||||||
Role::Admin,
|
Role::Admin,
|
||||||
"Hello there, I'm the admin",
|
"Hello there, I'm the admin",
|
||||||
"admin@example.com".to_owned(),
|
"admin@example.com".to_owned(),
|
||||||
"invalid_admin_password".to_owned(),
|
Some("invalid_admin_password".to_owned()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let user = NewUser::new_local(
|
let user = NewUser::new_local(
|
||||||
|
@ -1159,7 +1159,7 @@ pub(crate) mod tests {
|
||||||
Role::Normal,
|
Role::Normal,
|
||||||
"Hello there, I'm no one",
|
"Hello there, I'm no one",
|
||||||
"user@example.com".to_owned(),
|
"user@example.com".to_owned(),
|
||||||
"invalid_user_password".to_owned(),
|
Some("invalid_user_password".to_owned()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let other = NewUser::new_local(
|
let other = NewUser::new_local(
|
||||||
|
@ -1169,7 +1169,7 @@ pub(crate) mod tests {
|
||||||
Role::Normal,
|
Role::Normal,
|
||||||
"Hello there, I'm someone else",
|
"Hello there, I'm someone else",
|
||||||
"other@example.com".to_owned(),
|
"other@example.com".to_owned(),
|
||||||
"invalid_other_password".to_owned(),
|
Some("invalid_other_password".to_owned()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
vec![admin, user, other]
|
vec![admin, user, other]
|
||||||
|
@ -1188,7 +1188,7 @@ pub(crate) mod tests {
|
||||||
Role::Normal,
|
Role::Normal,
|
||||||
"Hello I'm a test",
|
"Hello I'm a test",
|
||||||
"test@example.com".to_owned(),
|
"test@example.com".to_owned(),
|
||||||
User::hash_pass("test_password").unwrap(),
|
Some(User::hash_pass("test_password").unwrap()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -1271,12 +1271,12 @@ pub(crate) mod tests {
|
||||||
Role::Normal,
|
Role::Normal,
|
||||||
"Hello I'm a test",
|
"Hello I'm a test",
|
||||||
"test@example.com".to_owned(),
|
"test@example.com".to_owned(),
|
||||||
User::hash_pass("test_password").unwrap(),
|
Some(User::hash_pass("test_password").unwrap()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
assert!(test_user.auth("test_password"));
|
assert_eq!(User::login(conn, "test", "test_password").unwrap().id, test_user.id);
|
||||||
assert!(!test_user.auth("other_password"));
|
assert!(User::login(conn, "test", "other_password").is_err());
|
||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue