Logo: Relish

  1. Sign in

Project: Apiv3

Users

TODO: Document Purpose and Usage

Scenarios
Fetching the root User collection.
When
I GET to /users
Then
I should get a 200 OK status code
And
the response is the User collection
Updating a User.
Given
I have 1 User
And
the User's initial facebook_id attribute is '123'
When
I PATCH to /users/:user_id giving the user_id with the body:
{
  "template": {
    "data": [
      {"name": "facebook_id", "value": "456"}
    ]
  }
}
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 1 User
And
the User's facebook_id attribute is '456'
Updating a User with non-permitted attributes.
Given
I have 1 User
And
the User's initial is_admin attribute is 'false'
When
I PATCH to /users/:user_id giving the user_id with the body:
{
  "template": {
    "data": [
      {"name": "is_admin", "value": true}
    ]
  }
}
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 1 User
And
the User's is_admin attribute is 'false'
Updating an invalid User.
Given
I have an invalid User
When
I PATCH to /users/:user_id giving the user_id with the body:
{
  "template": {
    "data": [
      {"name": "facebook_id", "value": "456"}
    ]
  }
}
Then
I should get a 404 NOT FOUND status code
Fetching a User.
Given
I have 1 User
When
I GET to /users/:user_id giving the user_id
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 1 User
Fetching multiple Users.
Given
I have 2 Users
When
I GET to /users/:user_id giving the user_id
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 2 Users
Fetching an invalid User.
Given
I have an invalid User
When
I GET to /users/:user_id giving the user_id
Then
I should get a 404 NOT FOUND status code
Searching for a User.
Given
I have 1 User
When
I GET to /users/search?id=:user_id giving the user_id
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 1 User
Searching for multiple Users.
Given
I have 2 Users
When
I GET to /users/search?id=:user_id giving the user_id
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 2 Users
Searching for an invalid User.
Given
I have an invalid User
When
I GET to /users/search?id=:user_id giving the user_id
Then
I should get a 200 OK status code
And
the response is the User collection
And
the response contains 0 Users

Last published almost 7 years ago by semmons99.