From 7c358c338f977e75d1b1abef07b578d2c2f12eb4 Mon Sep 17 00:00:00 2001 From: Flori Weber Date: Sat, 10 Jun 2023 19:42:41 +0200 Subject: [PATCH] Test singular role --- tests/roles.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/roles.rs b/tests/roles.rs index 3eee2b8..2663d25 100644 --- a/tests/roles.rs +++ b/tests/roles.rs @@ -34,3 +34,16 @@ async fn create_and_get_roles() { assert_eq!(role, expected); common::teardown(bundle).await } + +#[tokio::test] +async fn get_singular_role() { + let mut bundle = common::setup().await; + let guild_id = &bundle.guild.id.to_string(); + let role_id = &bundle.role.id.to_string(); + let role = bundle.role.clone(); + let same_role = chorus::types::RoleObject::get(&mut bundle.user, guild_id, role_id) + .await + .unwrap(); + assert_eq!(role, same_role); + common::teardown(bundle).await +}