Repository navigation
Sprint 4 PR 4.6b — integration tests for calendar router - #243
Merged
Merged
Conversation
Summary: Continues PR 4.6b file-by-file revival of the integration tier.
Adds real-HTTP coverage for /api/v1/calendar's subscription, token
reset, admin reset, and public feed endpoints. Locks in the self-or-
same-org-admin gate on GET/subscribe and POST/reset-token, the admin-
only /{person_id}/admin-reset flow, and the ICS content-type contract
of the public /feed/{token} endpoint.
Changed files:
- tests/integration/test_calendar.py (new) — 12 tests spanning:
- /subscribe: self OK, same-org admin OK, other-org admin 403,
missing person 404, unauthenticated 401/403
- /reset-token: self rotates (token changes), cross-org admin 403
- /{person_id}/admin-reset: admin OK, volunteer 403, cross-org 403
- /feed/{token}: valid token yields text/calendar (BEGIN/END VCALENDAR
verified in body), bogus token 404
Validation:
- poetry run pytest tests/integration/test_calendar.py -v — 12 passed
- poetry run black tests/integration/test_calendar.py — clean
- poetry run ruff check tests/integration/test_calendar.py — clean
- No OpenAPI snapshot refresh (no endpoints added or changed).
Follow-ups:
- Remaining integration files to revive: assignments, analytics,
solutions, solver, people, webhooks.
tomqwu
marked this pull request as ready for review
July 19, 2026 13:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues Sprint 4 PR 4.6b (file-by-file revival of the
tests/integration/tier). Adds a production-endpoint integration file that drives the/calendarrouter over real HTTP against the session-scoped uvicornapi_serverfixture. Covers the subscribe endpoint, self / admin token rotation, admin override, and the public token-authenticated ICS feed.Coverage
tests/integration/test_calendar.py— 12 tests covering:GET /calendar/subscribe— self OK, same-org admin OK, other-org admin 403, missing person 404, unauthenticated 401/403POST /calendar/reset-token— self rotates (token before/after differs), cross-org admin 403POST /calendar/{person_id}/admin-reset— admin OK (token rotated), volunteer 403, cross-org admin 403GET /calendar/feed/{token}— valid token yieldstext/calendarwithBEGIN:VCALENDAR…END:VCALENDAR, bogus token 404Validation
poetry run pytest tests/integration/test_calendar.py -v— 12 passedpoetry run black tests/integration/test_calendar.py— cleanpoetry run ruff check tests/integration/test_calendar.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
calendar_orgfixture provisions two orgs so cross-org access assertions are exercised against a real second-org admin, not just a syntheticorg_id./feed/{token}happy path first admin-creates an event, assigns the volunteer, then subscribes to get the token, then hits the feed — so the ICS body assertion isn't hollow (the router iterates real assignment/event rows).Follow-ups
Remaining routers still to revive under
tests/integration/: assignments, analytics, solutions, solver, people, webhooks.Generated by Claude Code