Sha256: ca118f74df455fa4230a15c49be97d70721ffe36d107d49ee5fad28ee04f55c3

Contents?: true

Size: 1.44 KB

Versions: 25

Compression:

Stored size: 1.44 KB

Contents

Feature: After a response has been served from Mirage, the content of the request that triggered it can be retrieved. This is useful
  for testing that the correct information was sent to the endpoint.

  On putting a respons template on to Mirage, a unique id is returned which can be used to look up the last request made to get that response.

  If the request body contains content this is stored. Otherwise it is the query string that is stored.

  Background: A template has already be put on Mirage
    Given I send PUT to 'http://localhost:7001/mirage/templates/greeting' with body 'Hello' and headers:
      | X-mirage-method | POST |


  Scenario: Getting request data when the data was in the body.
    Given I send POST to 'http://localhost:7001/mirage/responses/greeting' with request entity
    """
    Hello Mirage
    """
    When I send GET to 'http://localhost:7001/mirage/requests/1'
    Then 'Hello Mirage' should be returned


  Scenario: Getting request data when the data was in the query string.
    Given I send POST to 'http://localhost:7001/mirage/responses/greeting' with parameters:
      | surname   | Davis |
      | firstname | Leon  |
    When I send GET to 'http://localhost:7001/mirage/requests/1'
    Then 'surname=Davis&firstname=Leon' should be returned


  Scenario: Getting request data for a template that has not been served yet.
    Given I send GET to 'http://localhost:7001/mirage/requests/1'
    Then a 404 should be returned

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mirage-2.4.2 features/server/requests/get.feature
mirage-2.4.1 features/server/requests/get.feature
mirage-2.4.0 features/server/requests/get.feature
mirage-2.3.0 features/server/requests/get.feature
mirage-2.2.3 features/server/requests/get.feature
mirage-2.2.2 features/server/requests/get.feature
mirage-2.1.2 features/server/requests/get.feature
mirage-2.0.16 features/server/requests/get.feature
mirage-2.0.15 features/server/requests/get.feature
mirage-2.0.14 features/server/requests/get.feature
mirage-2.0.13 features/server/requests/get.feature
mirage-2.0.12 features/server/requests/get.feature
mirage-2.0.11 features/server/requests/get.feature
mirage-2.0.10 features/server/requests/get.feature
mirage-2.0.9 features/server/requests/get.feature
mirage-2.0.8 features/server/requests/get.feature
mirage-2.0.7 features/server/requests/get.feature
mirage-2.0.6 features/server/requests/get.feature
mirage-2.0.5 features/server/requests/get.feature
mirage-2.0.4 features/server/requests/get.feature