From 797af67d3a53661705d10b0d9d465b0d41c420f3 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Tue, 23 May 2023 15:25:47 +0200 Subject: [PATCH] Add get_channel integration test --- tests/integration.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index 7cf76cf..c30c3ad 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -101,7 +101,7 @@ async fn teardown(mut bundle: TestBundle) { } mod guild { - use chorus::api::{schemas, types}; + use chorus::api::{schemas, types, Channel}; #[tokio::test] async fn guild_creation_deletion() { @@ -130,4 +130,25 @@ mod guild { } crate::teardown(bundle).await } + + #[tokio::test] + async fn get_channel() { + let mut bundle = crate::setup().await; + let bundle_channel = bundle.channel.clone(); + let bundle_user = &mut bundle.user; + + assert_eq!( + bundle_channel, + Channel::get( + bundle_user.token.as_str(), + bundle.instance.urls.get_api(), + bundle.guild_id.as_str(), + &mut bundle_user.limits, + &mut bundle.instance.limits + ) + .await + .unwrap() + ); + crate::teardown(bundle).await + } }