Modified some steps in data/handler features and added data/handler/error_itemnotfound feature

This commit is contained in:
Héctor Hurtado
2019-08-29 14:14:04 +02:00
parent fe0de6fc1b
commit 48ab14d49d
6 changed files with 72 additions and 41 deletions
+26 -11
View File
@@ -1,21 +1,36 @@
@wip
Feature: Retrieve a resource from a handler in Kapow! server.
Users can retrieve request handler resources
from the server by specifying the handler id
Feature: Retrieve a handler resource in Kapow! server.
Users can retrieve handler resources from
the server by specifying the handler id
and the resource path.
Scenario: Retrieve a resource for the current request.
Scenario: Retrieve a resource.
Get the "request/path" resource for the current
request through the handler id.
Given I have a Kapow! server with the following routes:
| method | url_pattern | entrypoint | command |
| GET | /listRootDir | /bin/sh -c | ls -la / \| response /body |
When I send a request to the route "/listRootDir"
And I get the resource "request/path" for the current request handler
Given I have a Kapow! server with the following testing routes:
| method | url_pattern |
| GET | /listRootDir |
When I send a request to the testing route "/listRootDir"
And I get the resource "request/path"
Then I get 200 as response code
And I get "OK" as response reason phrase
And I get the following response body:
And I get the following response raw body:
"""
/listRootDir
"""
Scenario: Retrieve a resource item.
Get the "request/headers/Host" item resource for
the current request through the handler id.
Given I have a Kapow! server with the following testing routes:
| method | url_pattern |
| GET | /listRootDir |
When I send a request to the testing route "/listRootDir"
And I get the resource "request/headers/Host"
Then I get 200 as response code
And I get "OK" as response reason phrase
And I get the following response raw body:
"""
localhost:8080
"""