blob: b678717aff8437541ec892c69d207de8c6199311 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use faker_rand::{
en_us::{addresses::CityName, names::FullName},
faker_impl_from_templates,
};
use rand;
use crate::{app::App, channel::Channel, clock::RequestedAt};
pub async fn create(app: &App, created_at: &RequestedAt) -> Channel {
let name = propose();
app.channels()
.create(&name, created_at)
.await
.expect("should always succeed if the channel is actually new")
}
pub fn propose() -> String {
rand::random::<Name>().to_string()
}
struct Name(String);
faker_impl_from_templates! {
Name; "{} {}", CityName, FullName;
}
|