Source

rest-api-blueprint / restapiblueprint / features / delete_person.feature

Full commit
Feature: Delete a person
  As an API client
  I want to be able to remove a person

  Background: Reset and have a valid user
    Given I am using server "http://localhost:5000/v1"
    And I set Accept header to "application/json"
    When I send a DELETE request to "people"
    Then the response status should be "200"

  Scenario: Cannot delete a person before they exist
    When I send a DELETE request to "people/fred"
    Then the response status should be "404"
    And the JSON at path "status" should be "error"
    And the JSON at path "message" should be "Person does not exist"

  Scenario: Delete a person
    When I send a PUT request to "people/fred"
    And I send a DELETE request to "people/fred"
    And I send a GET request to "people/fred"
    Then the response status should be "404"
    And the JSON at path "status" should be "error"
    And the JSON at path "message" should be "Person does not exist"