Logo: Relish

  1. Sign in

Project: Apiv3

Contact Email Addresses

TODO: Document Purpose and Usage

Scenarios
Fetching the root Contact Email Address collection.
When
I GET to /contact_email_addresses
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
Creating a Contact Email Address.
Given
I have a valid Contact id
When
I POST to /contact_email_addresses with the body:
{
  "template": {
    "data": [
      {"name": "email", "value": "[email protected]"},
      {"name": "contact_id", "value": <%= @contact_id %>}
    ]
  }
}
Then
I should get a 201 CREATED status code
And
the response location is /contact_email_addresses/{id}
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
And
the ContactEmailAddress's email attribute is '[email protected]'
And
the ContactEmailAddress's contact_id attribute is '<%= @contact_id %>'
Creating a new Contact Email Address with non-permitted attributes.
Given
I have a valid Contact id
When
I POST to /contact_email_addresses with the body:
{
  "template": {
    "data": [
      {"name": "email", "value": "[email protected]"},
      {"name": "contact_id", "value": <%= @contact_id %>},
      {"name": "created_at", "value": "2014-06-10T00:18:00Z"}
    ]
  }
}
Then
I should get a 201 CREATED status code
And
the response location is /contact_email_addresses/{id}
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
And
the ContactEmailAddress's email attribute is '[email protected]'
And
the ContactEmailAddress's contact_id attribute is '<%= @contact_id %>'
And
the ContactEmailAddress's created_at attribute is not '2014-06-10T00:18:00Z'
Updating a Contact Email Address.
Given
I have 1 ContactEmailAddress
And
the ContactEmailAddress's initial email attribute is '[email protected]'
When
I PATCH to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id with the body:
{
  "template": {
    "data": [
      {"name": "email", "value": "[email protected]"}
    ]
  }
}
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
And
the ContactEmailAddress's email attribute is '[email protected]'
Updating a Contact Email Address with non-permitted attributes.
Given
I have 1 ContactEmailAddress
When
I PATCH to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id with the body:
{
  "template": {
    "data": [
      {"name": "created_at", "value": "2014-06-10T00:18:00Z"}
    ]
  }
}
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
And
the ContactEmailAddress's created_at attribute is not '2014-06-10T00:18:00Z'
Updating an invalid Contact Email Address.
Given
I have an invalid ContactEmailAddress
When
I PATCH to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id with the body:
{
  "template": {
    "data": [
      {"name": "email", "value": "[email protected]"}
    ]
  }
}
Then
I should get a 404 NOT FOUND status code
Deleting a Contact Email Address.
Given
I have 1 ContactEmailAddress
When
I DELETE to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 204 NO CONTENT status code
Deleting an invalid Contact Email Address.
Given
I have an invalid ContactEmailAddress
When
I DELETE to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 404 NOT FOUND status code
Fetching a Contact Email Address.
Given
I have 1 ContactEmailAddress
When
I GET to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
Fetching multiple Contact Email Addresses.
Given
I have 2 ContactEmailAddresses
When
I GET to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 2 contact_email_addresses
Fetching an invalid Contact Email Address.
Given
I have an invalid ContactEmailAddress
When
I GET to /contact_email_addresses/:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 404 NOT FOUND status code
Searching for a Contact Email Address.
Given
I have 1 ContactEmailAddress
When
I GET to /contact_email_addresses/search?id=:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
Searching for multiple Contact Email Addresses.
Given
I have 2 ContactEmailAddresses
When
I GET to /contact_email_addresses/search?id=:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 2 contact_email_addresses
Searching for an invalid Contact Email Address.
Given
I have an invalid ContactEmailAddress
When
I GET to /contact_email_addresses/search?id=:contact_email_addresses_id giving the contact_email_addresses_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 0 contact_email_addresses
Searching for a Contact Email Address via team_id.
Given
I have 1 ContactEmailAddress
When
I GET to /contact_email_addresses/search?team_id=:team_id giving the team_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress
Searching for a Contact Email Address via contact_id.
Given
I have 1 ContactEmailAddress
When
I GET to /contact_email_addresses/search?contact_id=:contact_id giving the contact_id
Then
I should get a 200 OK status code
And
the response is the ContactEmailAddress collection
And
the response contains 1 ContactEmailAddress

Last published almost 7 years ago by semmons99.