mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 01:15:42 -06:00
19 lines
630 B
Rust
19 lines
630 B
Rust
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
|
|
}
|