Add modify_guild test

This commit is contained in:
bitfl0wer 2023-08-20 23:24:06 +02:00
parent 7eee08459b
commit 29d5fe947c
1 changed files with 18 additions and 1 deletions

View File

@ -1,4 +1,6 @@
use chorus::types::{CreateChannelInviteSchema, Guild, GuildBanCreateSchema, GuildCreateSchema}; use chorus::types::{
CreateChannelInviteSchema, Guild, GuildBanCreateSchema, GuildCreateSchema, GuildModifySchema,
};
mod common; mod common;
@ -66,3 +68,18 @@ async fn guild_create_ban() {
.is_err()); .is_err());
common::teardown(bundle).await common::teardown(bundle).await
} }
#[tokio::test]
async fn modify_guild() {
let mut bundle = common::setup().await;
let schema = GuildModifySchema {
name: Some("Mycoolguild".to_string()),
..Default::default()
};
let guild_id = bundle.guild.read().unwrap().id;
let result = Guild::modify(guild_id, schema, &mut bundle.user)
.await
.unwrap();
assert_eq!(result.name.unwrap(), "Mycoolguild".to_string());
common::teardown(bundle).await
}