feat: account deletion request and active-user check
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::support::{AcceptingAuth, test_app_state, test_app_state_with_follow_graph};
|
||||
use crate::support::{AcceptingAuth, test_app_state, test_app_state_with_repos};
|
||||
use axum::{
|
||||
Router,
|
||||
body::Body,
|
||||
@@ -6,6 +6,8 @@ use axum::{
|
||||
routing::get,
|
||||
};
|
||||
use domain::errors::DomainError;
|
||||
use domain::ports::UserRepository;
|
||||
use domain::testing::InMemoryStore;
|
||||
use std::sync::Arc;
|
||||
use tower::ServiceExt;
|
||||
use uuid::Uuid;
|
||||
@@ -257,8 +259,19 @@ impl domain::ports::FollowGraphQuery for FixedPendingCount {
|
||||
#[tokio::test]
|
||||
async fn pending_count_endpoint_reports_the_use_case_result() {
|
||||
let uid = domain::value_objects::UserId::from_uuid(Uuid::new_v4());
|
||||
let state = test_app_state_with_follow_graph(
|
||||
Arc::new(FixedPendingCount(3)),
|
||||
let users = InMemoryStore::new();
|
||||
users
|
||||
.save(&domain::testing::test_user_with_role(
|
||||
uid.clone(),
|
||||
domain::models::UserRole::Standard,
|
||||
))
|
||||
.await
|
||||
.unwrap();
|
||||
let state = test_app_state_with_repos(
|
||||
|repos| {
|
||||
repos.follow_graph = Arc::new(FixedPendingCount(3));
|
||||
repos.user = users as _;
|
||||
},
|
||||
Arc::new(AcceptingAuth(uid)),
|
||||
);
|
||||
let app = Router::new()
|
||||
|
||||
Reference in New Issue
Block a user