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