summaryrefslogtreecommitdiff
path: root/src/channel/routes/test/list.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-05 20:32:02 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-05 22:47:12 -0400
commit1fb26ad31d385ddc628e1b73d6a8764981ca6885 (patch)
treeda226cfc7e054ce93bf37da943a395dee226baa6 /src/channel/routes/test/list.rs
parent8edd5625ad5dde0ef1637d5c89e9901b3ee65d73 (diff)
Use `/api/boot` to bootstrap the client.
The client now takes an initial snapshot from the response to `/api/boot`, then picks up the event stream at the immediately-successive event to the moment the snapshot was taken. This commit removes the following unused endpoints: * `/api/channels` (GET) * `/api/channels/:channel/messages` (GET) The information therein is now part of the boot response. We can always add 'em back, but I wanted to clear the deck for designing something more capable, for dealing with client needs.
Diffstat (limited to 'src/channel/routes/test/list.rs')
-rw-r--r--src/channel/routes/test/list.rs65
1 files changed, 0 insertions, 65 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)));
-}