summaryrefslogtreecommitdiff
path: root/src/boot/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/routes')
-rw-r--r--src/boot/routes/get.rs6
-rw-r--r--src/boot/routes/test.rs12
2 files changed, 9 insertions, 9 deletions
diff --git a/src/boot/routes/get.rs b/src/boot/routes/get.rs
index 563fbf1..4873b7a 100644
--- a/src/boot/routes/get.rs
+++ b/src/boot/routes/get.rs
@@ -3,19 +3,19 @@ use axum::{
response::{self, IntoResponse},
};
-use crate::{app::App, boot::Snapshot, error::Internal, login::Login, token::extract::Identity};
+use crate::{app::App, boot::Snapshot, error::Internal, token::extract::Identity, user::User};
pub async fn handler(State(app): State<App>, identity: Identity) -> Result<Response, Internal> {
let snapshot = app.boot().snapshot().await?;
Ok(Response {
- login: identity.login,
+ user: identity.user,
snapshot,
})
}
#[derive(serde::Serialize)]
pub struct Response {
- pub login: Login,
+ pub user: User,
#[serde(flatten)]
pub snapshot: Snapshot,
}
diff --git a/src/boot/routes/test.rs b/src/boot/routes/test.rs
index 202dcb9..55802fe 100644
--- a/src/boot/routes/test.rs
+++ b/src/boot/routes/test.rs
@@ -12,20 +12,20 @@ async fn returns_identity() {
.await
.expect("boot always succeeds");
- assert_eq!(viewer.login, response.login);
+ assert_eq!(viewer.user, response.user);
}
#[tokio::test]
async fn includes_logins() {
let app = fixtures::scratch_app().await;
- let spectator = fixtures::login::create(&app, &fixtures::now()).await;
+ let spectator = fixtures::user::create(&app, &fixtures::now()).await;
let viewer = fixtures::identity::fictitious();
let response = get::handler(State(app), viewer)
.await
.expect("boot always succeeds");
- assert!(response.snapshot.logins.contains(&spectator));
+ assert!(response.snapshot.users.contains(&spectator));
}
#[tokio::test]
@@ -44,7 +44,7 @@ async fn includes_channels() {
#[tokio::test]
async fn includes_messages() {
let app = fixtures::scratch_app().await;
- let sender = fixtures::login::create(&app, &fixtures::now()).await;
+ let sender = fixtures::user::create(&app, &fixtures::now()).await;
let channel = fixtures::channel::create(&app, &fixtures::now()).await;
let message = fixtures::message::send(&app, &channel, &sender, &fixtures::now()).await;
@@ -59,7 +59,7 @@ async fn includes_messages() {
#[tokio::test]
async fn excludes_expired_messages() {
let app = fixtures::scratch_app().await;
- let sender = fixtures::login::create(&app, &fixtures::ancient()).await;
+ let sender = fixtures::user::create(&app, &fixtures::ancient()).await;
let channel = fixtures::channel::create(&app, &fixtures::ancient()).await;
let expired_message =
fixtures::message::send(&app, &channel, &sender, &fixtures::ancient()).await;
@@ -80,7 +80,7 @@ async fn excludes_expired_messages() {
#[tokio::test]
async fn excludes_deleted_messages() {
let app = fixtures::scratch_app().await;
- let sender = fixtures::login::create(&app, &fixtures::now()).await;
+ let sender = fixtures::user::create(&app, &fixtures::now()).await;
let channel = fixtures::channel::create(&app, &fixtures::now()).await;
let deleted_message = fixtures::message::send(&app, &channel, &sender, &fixtures::now()).await;