Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Members API #10

Open
tyndyll opened this issue Nov 11, 2017 · 1 comment
Open

Create Members API #10

tyndyll opened this issue Nov 11, 2017 · 1 comment
Labels
Milestone

Comments

@tyndyll
Copy link
Contributor

tyndyll commented Nov 11, 2017

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
@tyndyll tyndyll added the server label Nov 11, 2017
@tyndyll tyndyll added this to the poc milestone Nov 11, 2017
@philtweir
Copy link

philtweir commented Nov 11, 2017

Some custom resource-based steps added to facilitate this task, as part of building #5 (within feature/membership-app)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants