diff options
| author | Austin Hellyer <[email protected]> | 2017-01-08 19:57:08 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-08 19:57:08 -0800 |
| commit | e85e901062e8b9ea717ec6c6253c9c7a300448d3 (patch) | |
| tree | 0c1dea105cf99c06699d8cea8c8999a77ed7d26d /tests | |
| parent | Simplify Reaction::delete() (diff) | |
| download | serenity-e85e901062e8b9ea717ec6c6253c9c7a300448d3.tar.xz serenity-e85e901062e8b9ea717ec6c6253c9c7a300448d3.zip | |
Add User::default_avatar_url() method
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_user.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_user.rs b/tests/test_user.rs index 21c336d..702c301 100644 --- a/tests/test_user.rs +++ b/tests/test_user.rs @@ -26,3 +26,19 @@ fn test_core() { user.avatar = None; assert!(user.avatar_url().is_none()); } + +#[test] +fn default_avatars() { + let mut user = gen(); + + user.discriminator = "0".to_owned(); + assert!(user.default_avatar_url().unwrap().ends_with("1b.png")); + user.discriminator = "1".to_owned(); + assert!(user.default_avatar_url().unwrap().ends_with("68.png")); + user.discriminator = "2".to_owned(); + assert!(user.default_avatar_url().unwrap().ends_with("4d.png")); + user.discriminator = "3".to_owned(); + assert!(user.default_avatar_url().unwrap().ends_with("aa.png")); + user.discriminator = "4".to_owned(); + assert!(user.default_avatar_url().unwrap().ends_with("29.png")); +} |