refactor: clean test setup code, cleanup tests, separate into different files

This commit is contained in:
Ryan Walters
2025-09-19 09:50:22 -05:00
parent 54eca9f447
commit 698f95ff32
7 changed files with 214 additions and 214 deletions

View File

@@ -0,0 +1,18 @@
mod common;
use crate::common::{test_context, TestContext};
use pretty_assertions::assert_eq;
/// Test session management endpoints
#[tokio::test]
async fn test_session_management() {
let TestContext { server, .. } = test_context().use_database(true).call().await;
// Test logout endpoint (should redirect)
let response = server.get("/logout").await;
assert_eq!(response.status_code(), 302); // Redirect to home
// Test profile endpoint without session (should be unauthorized)
let response = server.get("/profile").await;
assert_eq!(response.status_code(), 401); // Unauthorized without session
}