summaryrefslogtreecommitdiff
path: root/src/channel/routes/test.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-25 00:33:16 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-25 00:56:48 -0400
commit5423ec3937a4e28f3958a71b3db7498a4c427dc1 (patch)
tree8fc8531086c1691b0a9fc0a5ddb615d913dc6448 /src/channel/routes/test.rs
parenteae0edb57e9ade7c73affb78baf2ae267b6290b8 (diff)
Tests for purged channels and messages.
This required a re-think of the `.immediately()` combinator, to generalize it to cases where a message is _not_ expected. That (more or less immediately) suggested some mixed combinators, particularly for stream futures (futures of `Option<T>`).
Diffstat (limited to 'src/channel/routes/test.rs')
-rw-r--r--src/channel/routes/test.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/channel/routes/test.rs b/src/channel/routes/test.rs
index 46c58b0..10b1e8d 100644
--- a/src/channel/routes/test.rs
+++ b/src/channel/routes/test.rs
@@ -7,7 +7,7 @@ use super::post;
use crate::{
channel::app,
name::Name,
- test::fixtures::{self, future::Immediately as _},
+ test::fixtures::{self, future::Expect as _},
};
#[tokio::test]
@@ -39,7 +39,6 @@ async fn new_channel() {
.channels()
.get(&response.id)
.await
- .expect("searching for channels by ID never fails")
.expect("the newly-created channel exists");
assert_eq!(response, channel);
@@ -52,11 +51,7 @@ async fn new_channel() {
.filter_map(fixtures::event::channel::created)
.filter(|event| future::ready(event.channel == response));
- let event = events
- .next()
- .immediately()
- .await
- .expect("creation event published");
+ let event = events.next().expect_some("creation event published").await;
assert_eq!(event.channel, response);
}
@@ -165,7 +160,6 @@ async fn name_reusable_after_delete() {
.channels()
.get(&response.id)
.await
- .expect("searching for channels by ID never fails")
.expect("the newly-created channel exists");
assert_eq!(response, channel);
}
@@ -215,7 +209,6 @@ async fn name_reusable_after_expiry() {
.channels()
.get(&response.id)
.await
- .expect("searching for channels by ID never fails")
.expect("the newly-created channel exists");
assert_eq!(response, channel);
}