|
|
|
@ -666,13 +666,15 @@ mod tests { |
|
|
|
|
assert!(!group.is_banned("piggo@piggo.space"), "user not banned by default"); |
|
|
|
|
|
|
|
|
|
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.can_write("piggo@piggo.space"), "banned member can't post"); |
|
|
|
|
|
|
|
|
|
// unban
|
|
|
|
|
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"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|