summaryrefslogtreecommitdiff
path: root/src/channel/handlers/create
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-06-20 19:47:46 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-06-20 22:42:55 -0400
commit7778cdf0c495a04f4f5f3f85b78348c8037a5771 (patch)
treebd0e00d36ab1863f5609a3c0ee8936782ae794ca /src/channel/handlers/create
parent639f4b422adb0a6fc809161dd816d8382cf88138 (diff)
Remove the snapshot fields from `/api/boot`.
Clients now _must_ construct their state from the event stream; it is no longer possible for them to delegate that work to the server.
Diffstat (limited to 'src/channel/handlers/create')
-rw-r--r--src/channel/handlers/create/test.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/channel/handlers/create/test.rs b/src/channel/handlers/create/test.rs
index 595a879..31bb778 100644
--- a/src/channel/handlers/create/test.rs
+++ b/src/channel/handlers/create/test.rs
@@ -2,6 +2,7 @@ use std::future;
use axum::extract::{Json, State};
use futures::stream::StreamExt as _;
+use itertools::Itertools;
use crate::{
channel::app,
@@ -33,7 +34,14 @@ async fn new_channel() {
// Verify the semantics
let snapshot = app.boot().snapshot().await.expect("boot always succeeds");
- assert!(snapshot.channels.iter().any(|channel| channel == &response));
+ let created = snapshot
+ .events
+ .into_iter()
+ .filter_map(fixtures::event::channel)
+ .filter_map(fixtures::event::channel::created)
+ .exactly_one()
+ .expect("only one channel has been created");
+ assert_eq!(response, created.channel);
let channel = app
.channels()