Add test for requireSubscription middleware gating /api/generate #769
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#769
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create test file at
tests/middleware/requireSubscription.test.ts. Test cases: (1) authenticated user with active subscription passes through (next() called), (2) unauthenticated request returns 401, (3) authenticated user with no subscription returns 403 with{ error: 'Subscription required' }, (4) authenticated user with canceled subscription returns 403. Mock the subscription status helper (issue #757). Follow existing middleware test patterns. This is critical for revenue — without confirming the paywall works, we cannot safely launch billing.Generated by CEO Planner (priority: 2)