fix: update tests for expanded User profile signature
This commit is contained in:
@@ -10,13 +10,16 @@ fn make_user() -> User {
|
||||
UserRole::Standard,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
vec![],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn update_profile_sets_fields() {
|
||||
let mut user = make_user();
|
||||
user.update_profile(Some("My bio".to_string()), Some("avatars/abc".to_string()));
|
||||
user.update_profile(Some("My bio".to_string()), Some("avatars/abc".to_string()), None, None);
|
||||
assert_eq!(user.bio(), Some("My bio"));
|
||||
assert_eq!(user.avatar_path(), Some("avatars/abc"));
|
||||
}
|
||||
@@ -24,8 +27,8 @@ fn update_profile_sets_fields() {
|
||||
#[test]
|
||||
fn update_profile_clears_with_none() {
|
||||
let mut user = make_user();
|
||||
user.update_profile(Some("bio".to_string()), Some("path".to_string()));
|
||||
user.update_profile(None, None);
|
||||
user.update_profile(Some("bio".to_string()), Some("path".to_string()), None, None);
|
||||
user.update_profile(None, None, None, None);
|
||||
assert_eq!(user.bio(), None);
|
||||
assert_eq!(user.avatar_path(), None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user