c/backend › command
0votes

Write integration tests for an endpointPromptLow risk

submitted by u/client to c/backend · 0 copies

Cover the happy path, auth and the edge cases that bite in production.

Prompt · 2 variables
Write integration tests for this endpoint using {{test_framework}}:

{{endpoint_code}}

Cover at minimum:
- Success with valid input (assert body and status).
- Missing/invalid auth → 401/403.
- Validation failures for each required field.
- Not found and conflict cases.
- Rate limit or duplicate submission behavior if present.

Use factories for test data, clean up after each test, and don't mock the database unless I say so.
0 commentsreport
0 comments

Log in to join the discussion.