Add kick member spell
This commit is contained in:
parent
6ba2cd4959
commit
22506e8380
|
@ -85,3 +85,28 @@ async fn modify_guild() {
|
||||||
assert_eq!(result.name.unwrap(), "Mycoolguild".to_string());
|
assert_eq!(result.name.unwrap(), "Mycoolguild".to_string());
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn guild_remove_member() {
|
||||||
|
let mut bundle = common::setup().await;
|
||||||
|
let channel = bundle.channel.read().unwrap().clone();
|
||||||
|
let mut other_user = bundle.create_user("testuser1312").await;
|
||||||
|
let user = &mut bundle.user;
|
||||||
|
let create_channel_invite_schema = CreateChannelInviteSchema::default();
|
||||||
|
let guild = bundle.guild.read().unwrap().clone();
|
||||||
|
let invite = user
|
||||||
|
.create_channel_invite(create_channel_invite_schema, channel.id)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
other_user.accept_invite(&invite.code, None).await.unwrap();
|
||||||
|
let other_user_id = other_user.object.read().unwrap().id;
|
||||||
|
Guild::remove_member(guild.id, other_user_id, None, &mut bundle.user)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
assert!(
|
||||||
|
Guild::remove_member(guild.id, other_user_id, None, &mut bundle.user,)
|
||||||
|
.await
|
||||||
|
.is_err()
|
||||||
|
);
|
||||||
|
common::teardown(bundle).await
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue