You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.2 KiB
1.2 KiB
quotesdb Integration Tests
Integration tests for the quotesdb API, located in this directory.
Running
# From quotesdb/
cargo test
Integration tests run automatically as part of cargo test.
Structure
Each test file focuses on one area of the API:
| File | Coverage |
|---|---|
api_spec.rs |
GET /api/ — OpenAPI spec shape |
quotes_list.rs |
GET /api/quotes — pagination, filters |
quotes_random.rs |
GET /api/quotes/random — 200 and empty DB |
quotes_crud.rs |
PUT, POST, DELETE — create, update, delete |
auth.rs |
Auth code validation, 403 responses |
tags.rs |
Tag create, filter, replace on update |
router_order.rs |
/random not matched as :id |
Test harness
All tests use a shared harness (harness.rs) that:
- Creates a temporary SQLite database
- Spawns an Axum server on a random port
- Returns the server address for
reqwestclients to hit - Cleans up the database on drop
Notes
- Tests require no external services — all run against a local SQLite database
- Each test gets its own isolated database to avoid state contamination
- The API server target must build natively (
cargo testuses the host target)