Skip to content

Commit

Permalink
Add acceptance tests for template defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlloyd committed Jan 21, 2018
1 parent 7f18afa commit fb29560
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/acceptance-tests/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ def step_impl(context):
accept-encoding: gzip
user-agent: RIF/0.1.0"""[1:]

@given(u'a .rif file is on disk that has a URL template with a default')
def step_impl(context):
context.filename = '/vol/tests/test-data/url-params.rif'
context.variables = {}
context.expected_result = """
GET /url-params?count=10 HTTP/1.1
host: localhost:8080
accept-encoding: gzip
user-agent: RIF/0.1.0"""[1:]

@when(u'the user runs RIF on that file passing in the appropriate variables')
def step_impl(context):
variable_args = [
Expand Down
5 changes: 5 additions & 0 deletions tests/acceptance-tests/template-parameters.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ Feature: Template Parameters
Given a .rif file is on disk that has a URL template
When the user runs RIF on that file passing in the appropriate variables
Then RIF should return an echo of the request it made

Scenario: The user makes a request with a URL template from a .rif file
Given a .rif file is on disk that has a URL template with a default
When the user runs RIF on that file passing in the appropriate variables
Then RIF should return an echo of the request it made

0 comments on commit fb29560

Please sign in to comment.