---
# quotesdb-2nlt
title: 'Test suite: GET /api/quotes/:id — 200 with quote, 404 not found, schema validation'
status: completed
type: task
priority: normal
created_at: 2026-03-10T23:32:11Z
updated_at: 2026-03-10T23:32:20Z
blocked_by:
- quotesdb-gu9j
- quotesdb-nrue
---
Integration tests live in `tests/` and exercise the API binary against a temporary SQLite database. They run with `cargo test` and must not require a running Cloudflare environment. The test harness spawns the API server on a random port and returns the base URL.
Write the `GET /api/quotes/:id` test suite in `tests/test_get_quote.rs` (or similar). Test cases:
1. 200 with full quote object — verify all fields present, tags included
2. 404 Not Found — verify JSON error body `{"error": "..."}`
3. Schema validation — verify the returned quote matches the expected JSON shape
- Use the shared test harness from ticket 9b581f.
- Create a quote via `PUT /api/quotes` in the test setup before fetching it.
- Validate the response body against the expected quote schema (all required fields present).
Use `superpowers:verification-before-completion` before closing.
Run in order from the `quotesdb/` directory:
```sh
cargo fmt
cargo check
cargo clippy
cargo test
```
`test(quotesdb): add GET /api/quotes/:id test suite`