Sha256: f17a874f453308258ce9b91e768e776387bee20d20a58d8b387250870699b0ad

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

Feature: Substituting values from requests in to a template
  Parts of a response can be substitued for values found in the request body or query string.
  This allows dynamic content to be sent back to a client.

  To do this, substitution, matchers must be put in the the response value.

  Either a string literal or a regex can be used in between ${} to find a match

  Scenario: A response template populated from matches found in the request body using a regex
    Given the following template template:
    """
      {
         "response":{
            "body":"Hello ${name}"
         }
      }
    """
    And 'response.body' is base64 encoded
    And the template is sent using PUT to '/templates/greeting'
    When I send GET to '/responses/greeting' with parameters:
      |name|Joe  |
    Then 'Hello Joe' should be returned

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mirage-3.0.0.alpha.17 features/templates/put_with_substitutions.feature
mirage-3.0.0.alpha.16 features/templates/put_with_substitutions.feature
mirage-3.0.0.alpha.15 features/templates/put_with_substitutions.feature
mirage-3.0.0.alpha.14 features/templates/put_with_substitutions.feature
mirage-3.0.0.alpha.13 features/templates/put_with_substitutions.feature
mirage-3.0.0.alpha.12 features/templates/put_with_substitutions.feature