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.
50 lines
1.4 KiB
Markdown
50 lines
1.4 KiB
Markdown
---
|
|
# quotesdb-v3dw
|
|
title: 'Test suite: DELETE /api/quotes/:id — valid auth 204 no body, wrong auth 403, not found 404, cascade deletes tags'
|
|
status: completed
|
|
type: task
|
|
priority: normal
|
|
created_at: 2026-03-10T23:32:08Z
|
|
updated_at: 2026-03-10T23:32:16Z
|
|
blocked_by:
|
|
- quotesdb-gu9j
|
|
- quotesdb-ode0
|
|
---
|
|
|
|
<context>
|
|
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.
|
|
</context>
|
|
|
|
<goal>
|
|
Write the `DELETE /api/quotes/:id` test suite in `tests/test_delete_quote.rs` (or similar). Test cases:
|
|
1. Valid auth — 204 No Content, no response body
|
|
2. Wrong auth code — 403 Forbidden
|
|
3. Not found ID — 404 Not Found
|
|
4. Cascade deletes tags — verify `GET /api/quotes/:id` returns 404 after deletion and tags are gone
|
|
</goal>
|
|
|
|
<constraints>
|
|
- Use the shared test harness from ticket 9b581f.
|
|
- Create a quote with tags before each test, use its auth_code for valid-auth tests.
|
|
- After successful delete, verify the quote is no longer retrievable.
|
|
</constraints>
|
|
|
|
<skills>
|
|
Use `superpowers:verification-before-completion` before closing.
|
|
</skills>
|
|
|
|
<validation>
|
|
Run in order from the `quotesdb/` directory:
|
|
|
|
```sh
|
|
cargo fmt
|
|
cargo check
|
|
cargo clippy
|
|
cargo test
|
|
```
|
|
</validation>
|
|
|
|
<commit>
|
|
`test(quotesdb): add DELETE /api/quotes/:id test suite`
|
|
</commit>
|