diff options
| author | Zeyla Hellyer <[email protected]> | 2017-12-17 21:45:25 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-12-17 21:46:30 -0800 |
| commit | 2abeea53745b5ddfce33d9e1160c682888850344 (patch) | |
| tree | 81b535e64c25b27d5819f5c24caf6442101bce8d /tests | |
| parent | Default serde on a couple Ready structfields (diff) | |
| download | serenity-2abeea53745b5ddfce33d9e1160c682888850344.tar.xz serenity-2abeea53745b5ddfce33d9e1160c682888850344.zip | |
Fix `Guild` deser without `system_channel_id`
Fix the deserialization of `model::guild::Guild` when
`Guild::system_channel_id` is not present.
Additionally, add a test case for this.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/resources/guild_system_channel_id_missing.json | 23 | ||||
| -rw-r--r-- | tests/test_deser.rs | 7 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/resources/guild_system_channel_id_missing.json b/tests/resources/guild_system_channel_id_missing.json new file mode 100644 index 0000000..be5c89d --- /dev/null +++ b/tests/resources/guild_system_channel_id_missing.json @@ -0,0 +1,23 @@ +{ + "id": "244567637332328449", + "name": "testtest", + "icon": "3af6e2ebf46e85158a5fbc1a4f934bd6", + "owner_id": "114941315417899012", + "region": "us-east", + "afk_timeout": 60, + "verification_level": 2, + "roles": [], + "emojis": [], + "features": [], + "large": false, + "voice_states": [], + "unavailable": false, + "member_count": 1337, + "members": [], + "channels": [], + "presences": [], + "default_message_notifications": 1, + "explicit_content_filter": 0, + "joined_at": "2017-12-12T00:10:08.769400+00:00", + "mfa_level": 0 +} diff --git a/tests/test_deser.rs b/tests/test_deser.rs index b17fe3c..ae9536b 100644 --- a/tests/test_deser.rs +++ b/tests/test_deser.rs @@ -178,3 +178,10 @@ fn message_type_7() { fn guild_features_deser() { p!(GuildCreateEvent, "guild_create_features"); } + +// Ensure that `Guild`s still deserialize despite the `system_channel_id` key +// missing. +#[test] +fn guild_system_channel_id_missing() { + p!(Guild, "guild_system_channel_id_missing"); +} |