Fix minor mistakes in tests that made them fail

This commit is contained in:
Francesco Gazzetta 2021-11-01 19:29:20 +01:00
parent ebcf12e46c
commit 900f499932
2 changed files with 5 additions and 3 deletions

View file

@ -666,13 +666,15 @@ mod tests {
assert!(!group.is_banned("piggo@piggo.space"), "user not banned by default"); assert!(!group.is_banned("piggo@piggo.space"), "user not banned by default");
group.ban_user("piggo@piggo.space", true).unwrap(); group.ban_user("piggo@piggo.space", true).unwrap();
assert!(group.is_member("piggo@piggo.space"), "still member even if banned"); assert!(!group.is_member("piggo@piggo.space"), "banned user is kicked");
assert!(group.is_banned("piggo@piggo.space"), "banned user is banned"); assert!(group.is_banned("piggo@piggo.space"), "banned user is banned");
assert!(!group.can_write("piggo@piggo.space"), "banned member can't post"); assert!(!group.can_write("piggo@piggo.space"), "banned member can't post");
// unban // unban
group.ban_user("piggo@piggo.space", false).unwrap(); group.ban_user("piggo@piggo.space", false).unwrap();
assert!(!group.can_write("piggo@piggo.space"), "unbanned member is still kicked");
group.set_member("piggo@piggo.space", true).unwrap();
assert!(group.can_write("piggo@piggo.space"), "un-ban works"); assert!(group.can_write("piggo@piggo.space"), "un-ban works");
} }

View file

@ -82,11 +82,11 @@ mod test {
); );
assert_eq!( assert_eq!(
Ok("piggo@piggo.space".into()), Ok("piggo@piggo.space".into()),
normalize_acct("piGGgo@pIggo.spaCe", "uhh") normalize_acct("piGGo@pIggo.spaCe", "uhh")
); );
assert_eq!( assert_eq!(
Ok("piggo@banana.nana".into()), Ok("piggo@banana.nana".into()),
normalize_acct("piGGgo", "foo@baNANA.nana") normalize_acct("piGGo", "foo@baNANA.nana")
); );
assert_eq!(Err(GroupError::BadConfig("_".into())), normalize_acct("piggo", "uhh")); assert_eq!(Err(GroupError::BadConfig("_".into())), normalize_acct("piggo", "uhh"));
} }