mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-07 18:07:42 -06:00
fix(tests): update all test routes to use /api prefix
All API routes were moved under /api prefix as part of the unified deployment architecture. Updated test files to reflect this change: - basics.rs: Update root and auth/providers routes - health.rs: Update health endpoint routes - oauth.rs: Update all OAuth and auth callback routes, plus redirect locations - sessions.rs: Update profile and logout routes This fixes 9 failing tests that were expecting routes without the /api prefix.
This commit is contained in:
@@ -40,16 +40,16 @@ async fn test_session_management() {
|
||||
// 3. Make a request to the protected route WITH the session, expect success
|
||||
let response = context
|
||||
.server
|
||||
.get("/profile")
|
||||
.get("/api/profile")
|
||||
.add_cookie(Cookie::new(session::SESSION_COOKIE_NAME, token))
|
||||
.await;
|
||||
assert_eq!(response.status_code(), 200);
|
||||
|
||||
// 4. Sign out
|
||||
let response = context.server.get("/logout").await;
|
||||
let response = context.server.get("/api/logout").await;
|
||||
assert_eq!(response.status_code(), 302); // Redirect after logout
|
||||
|
||||
// 5. Make a request to the protected route without a session, expect failure
|
||||
let response = context.server.get("/profile").await;
|
||||
let response = context.server.get("/api/profile").await;
|
||||
assert_eq!(response.status_code(), 401); // Unauthorized without session
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user