summaryrefslogtreecommitdiff
path: root/src/channel/routes/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel/routes/test')
-rw-r--r--src/channel/routes/test/list.rs65
-rw-r--r--src/channel/routes/test/mod.rs1
2 files changed, 0 insertions, 66 deletions
diff --git a/src/channel/routes/test/list.rs b/src/channel/routes/test/list.rs
deleted file mode 100644
index f15a53c..0000000
--- a/src/channel/routes/test/list.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-use axum::extract::State;
-use axum_extra::extract::Query;
-
-use crate::{channel::routes, test::fixtures};
-
-#[tokio::test]
-async fn empty_list() {
- // Set up the environment
-
- let app = fixtures::scratch_app().await;
- let viewer = fixtures::login::create(&app).await;
-
- // Call the endpoint
-
- let routes::Channels(channels) = routes::list(State(app), viewer, Query::default())
- .await
- .expect("always succeeds");
-
- // Verify the semantics
-
- assert!(channels.is_empty());
-}
-
-#[tokio::test]
-async fn one_channel() {
- // Set up the environment
-
- let app = fixtures::scratch_app().await;
- let viewer = fixtures::login::create(&app).await;
- let channel = fixtures::channel::create(&app, &fixtures::now()).await;
-
- // Call the endpoint
-
- let routes::Channels(channels) = routes::list(State(app), viewer, Query::default())
- .await
- .expect("always succeeds");
-
- // Verify the semantics
-
- assert!(channels.contains(&channel));
-}
-
-#[tokio::test]
-async fn multiple_channels() {
- // Set up the environment
-
- let app = fixtures::scratch_app().await;
- let viewer = fixtures::login::create(&app).await;
- let channels = vec![
- fixtures::channel::create(&app, &fixtures::now()).await,
- fixtures::channel::create(&app, &fixtures::now()).await,
- ];
-
- // Call the endpoint
-
- let routes::Channels(response_channels) = routes::list(State(app), viewer, Query::default())
- .await
- .expect("always succeeds");
-
- // Verify the semantics
-
- assert!(channels
- .into_iter()
- .all(|channel| response_channels.contains(&channel)));
-}
diff --git a/src/channel/routes/test/mod.rs b/src/channel/routes/test/mod.rs
index ab663eb..3e5aa17 100644
--- a/src/channel/routes/test/mod.rs
+++ b/src/channel/routes/test/mod.rs
@@ -1,3 +1,2 @@
-mod list;
mod on_create;
mod on_send;