You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Django REST Framework create an endpoint at /api/members and /api/members/:id which will list all active members and return a single member respectively.
The endpoint should be authenticated, and only accessible to users in the management Django group
Feature: Accessing /api/members as a member of the management group
Given I am authenticated as a management user
When I make a request to the list members endpoint
Then I will receive a 200 response
And the ["members"] field will be populated
Feature: Accessing /api/members/:id as a member of the management group
Given I am authenticated as a management user
When I make a request to the get member 1 endpoint
Then I will receive a 200 response
And the ["id"] field will equal 1
Feature: Accessing /api/members as a member
Given I am authenticated as a user
When I make a request to the list members endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members/:id as a member
Given I am authenticated as a user
When I make a request to the get member 1 endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members as an unauthenticated user
When I make a request to the list members endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members/:id as an unauthenticated user
When I make a request to the get member 1 endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Definition of Done
Endpoints accessible via a request to /api/members and /api/members/:id
Tests written
Behave features written and working
The text was updated successfully, but these errors were encountered:
Using Django REST Framework create an endpoint at /api/members and /api/members/:id which will list all active members and return a single member respectively.
The endpoint should be authenticated, and only accessible to users in the
management
Django groupFeature: Accessing /api/members as a member of the management group
Given I am authenticated as a management user
When I make a request to the list members endpoint
Then I will receive a 200 response
And the ["members"] field will be populated
Feature: Accessing /api/members/:id as a member of the management group
Given I am authenticated as a management user
When I make a request to the get member 1 endpoint
Then I will receive a 200 response
And the ["id"] field will equal 1
Feature: Accessing /api/members as a member
Given I am authenticated as a user
When I make a request to the list members endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members/:id as a member
Given I am authenticated as a user
When I make a request to the get member 1 endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members as an unauthenticated user
When I make a request to the list members endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Feature: Accessing /api/members/:id as an unauthenticated user
When I make a request to the get member 1 endpoint
Then I will receive a 401 response
And the response will be "Unauthorized"
Definition of Done
The text was updated successfully, but these errors were encountered: