summaryrefslogtreecommitdiff
path: root/src/test/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/fixtures')
-rw-r--r--src/test/fixtures/identity.rs2
-rw-r--r--src/test/fixtures/login.rs2
-rw-r--r--src/test/fixtures/mod.rs6
-rw-r--r--src/test/fixtures/user.rs4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/test/fixtures/identity.rs b/src/test/fixtures/identity.rs
index 20929f9..adc3e73 100644
--- a/src/test/fixtures/identity.rs
+++ b/src/test/fixtures/identity.rs
@@ -14,7 +14,7 @@ use crate::{
},
};
-pub async fn create(app: &App, created_at: &RequestedAt) -> Identity {
+pub async fn create<P>(app: &App<P>, created_at: &RequestedAt) -> Identity {
let credentials = fixtures::user::create_with_password(app, created_at).await;
logged_in(app, &credentials, created_at).await
}
diff --git a/src/test/fixtures/login.rs b/src/test/fixtures/login.rs
index d9aca81..839a412 100644
--- a/src/test/fixtures/login.rs
+++ b/src/test/fixtures/login.rs
@@ -5,7 +5,7 @@ use crate::{
test::fixtures::user::{propose, propose_name},
};
-pub async fn create(app: &App, created_at: &DateTime) -> Login {
+pub async fn create<P>(app: &App<P>, created_at: &DateTime) -> Login {
let (name, password) = propose();
app.users()
.create(&name, &password, created_at)
diff --git a/src/test/fixtures/mod.rs b/src/test/fixtures/mod.rs
index 3d69cfa..53bf31b 100644
--- a/src/test/fixtures/mod.rs
+++ b/src/test/fixtures/mod.rs
@@ -1,6 +1,6 @@
use chrono::{TimeDelta, Utc};
-use crate::{app::App, clock::RequestedAt, db};
+use crate::{app::App, clock::RequestedAt, db, test::webpush::Client};
pub mod boot;
pub mod conversation;
@@ -13,11 +13,11 @@ pub mod login;
pub mod message;
pub mod user;
-pub async fn scratch_app() -> App {
+pub async fn scratch_app() -> App<Client> {
let pool = db::prepare("sqlite::memory:", "sqlite::memory:")
.await
.expect("setting up in-memory sqlite database");
- App::from(pool)
+ App::from(pool, Client::new())
}
pub fn now() -> RequestedAt {
diff --git a/src/test/fixtures/user.rs b/src/test/fixtures/user.rs
index d4d8db4..3ad4436 100644
--- a/src/test/fixtures/user.rs
+++ b/src/test/fixtures/user.rs
@@ -3,7 +3,7 @@ use uuid::Uuid;
use crate::{app::App, clock::RequestedAt, login::Login, name::Name, password::Password};
-pub async fn create_with_password(app: &App, created_at: &RequestedAt) -> (Name, Password) {
+pub async fn create_with_password<P>(app: &App<P>, created_at: &RequestedAt) -> (Name, Password) {
let (name, password) = propose();
let user = app
.users()
@@ -14,7 +14,7 @@ pub async fn create_with_password(app: &App, created_at: &RequestedAt) -> (Name,
(user.name, password)
}
-pub async fn create(app: &App, created_at: &RequestedAt) -> Login {
+pub async fn create<P>(app: &App<P>, created_at: &RequestedAt) -> Login {
super::login::create(app, created_at).await
}