mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-14 22:12:23 -06:00
refactor: clean test setup code, cleanup tests, separate into different files
This commit is contained in:
17
pacman-server/tests/basics.rs
Normal file
17
pacman-server/tests/basics.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
mod common;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use crate::common::{test_context, TestContext};
|
||||
|
||||
// A basic test of all the server's routes that aren't covered by other tests.
|
||||
#[tokio::test]
|
||||
async fn test_basic_routes() {
|
||||
let routes = vec!["/", "/auth/providers"];
|
||||
|
||||
for route in routes {
|
||||
let TestContext { server, .. } = test_context().use_database(false).call().await;
|
||||
let response = server.get(route).await;
|
||||
assert_eq!(response.status_code(), 200);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user