Replaced gherkin tables by json documents in requests and responses of insert features

This commit is contained in:
Héctor Hurtado
2019-08-21 11:03:29 +02:00
parent d7813f6487
commit 450bb48953
3 changed files with 211 additions and 40 deletions
@@ -9,13 +9,23 @@ Feature: Kapow! server reject insert responses with semantic errors.
Given I have a running Kapow! server
When I insert the route:
| entrypoint | command |
| /bin/sh -c | ls -la / \| response /body |
"""
{
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body"
}
"""
Then I get 422 as response code
And I get "Missing Mandatory Field" as response reason phrase
And I get the following entity as response body:
| missing_mandatory_fields |
| "url_pattern", "method" |
"""
{
"missing_mandatory_fields": [
"url_pattern",
"method"
]
}
"""
Scenario: Error because of wrong route specification.
If a request contains an invalid expression in the
@@ -23,8 +33,15 @@ Feature: Kapow! server reject insert responses with semantic errors.
Given I have a running Kapow! server
When I insert the route:
| method | url_pattern | entrypoint | command | index |
| GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 |
"""
{
"method": "GET",
"url_pattern": "+123--",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"index": 0
}
"""
Then I get 422 as response code
And I get "Invalid Route Spec" as response reason phrase
And I get an empty response body
@@ -35,8 +52,15 @@ Feature: Kapow! server reject insert responses with semantic errors.
Given I have a running Kapow! server
When I insert the route:
| method | url_pattern | entrypoint | command | index |
| AVECES | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 |
"""
{
"method": "SOMETIMES",
"url_pattern": "/",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"index": 0
}
"""
Then I get 422 as response code
And I get "Invalid Data Type" as response reason phrase
And I get an empty response body