diff --git a/crates/gatewayd/tests/serve_answers.rs b/crates/gatewayd/tests/serve_answers.rs index 0a343e7..eaacc17 100644 --- a/crates/gatewayd/tests/serve_answers.rs +++ b/crates/gatewayd/tests/serve_answers.rs @@ -105,10 +105,13 @@ impl Stage { .posted(&post(&id('c', n), user, DM, root, text, at), "D"); } - /// The text posted in the thread after the approval, within five seconds. - fn replies(&self, after: usize) -> Vec { - let posts = self.mm.wait_posts(after + 1, WAIT); - posts[after..].iter().map(|(_, _, t)| t.clone()).collect() + /// The first `count` posts after the first `after`, waiting up to five seconds for all of them. + fn replies(&self, after: usize, count: usize) -> Vec { + let posts = self.mm.wait_posts(after + count, WAIT); + posts[after..after + count] + .iter() + .map(|(_, _, t)| t.clone()) + .collect() } } @@ -193,7 +196,7 @@ fn nobody_else_and_nothing_else_answers_it() { s.command(4, KYLE, &root, "!approve 7", 7); s.command(5, KYLE, &root, "!approve 42 please", 8); assert_eq!( - s.replies(1)[..5], + s.replies(1, 5), [ NOT_APPROVER.to_string(), "approval 42 is answered in its own thread".to_string(),