Sha256: 30c17d5b1921c1c6fa6bdaa792018fd9bbafebc2a0ca06e4f3c13dd5c74b7426

Contents?: true

Size: 837 Bytes

Versions: 15

Compression:

Stored size: 837 Bytes

Contents

Feature: Substituting values from requests in to a template
  Parts of a response can be substituted 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

15 entries across 15 versions & 2 rubygems

Version Path
mirage-3.0.13 features/templates/put_with_substitutions.feature
mirage-3.0.12 features/templates/put_with_substitutions.feature
mirage-3.0.11 features/templates/put_with_substitutions.feature
mirage-3.0.10 features/templates/put_with_substitutions.feature
mirage-3.0.9 features/templates/put_with_substitutions.feature
mirage-on-thin-3.0.8 features/templates/put_with_substitutions.feature
mirage-3.0.8 features/templates/put_with_substitutions.feature
mirage-3.0.7 features/templates/put_with_substitutions.feature
mirage-3.0.6 features/templates/put_with_substitutions.feature
mirage-3.0.5 features/templates/put_with_substitutions.feature
mirage-3.0.4 features/templates/put_with_substitutions.feature
mirage-3.0.3 features/templates/put_with_substitutions.feature
mirage-3.0.2 features/templates/put_with_substitutions.feature
mirage-3.0.1 features/templates/put_with_substitutions.feature
mirage-3.0.0 features/templates/put_with_substitutions.feature