Review feature and scenario definitions. Removing unnecesary and redundant steps.

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-08-23 12:46:10 +02:00
parent 8752f419b5
commit 991ae618bb
13 changed files with 62 additions and 150 deletions
@@ -10,14 +10,7 @@ Feature: Kapow! server reject append requests with malformed JSON bodies.
Given I have a running Kapow! server
When I try to append with this malformed JSON document:
"""
{
"method" "GET",
"url_pattern": /hello,
"entrypoint": null
"command": "echo Hello
World | response /body",
"id": "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
}
Hi! I am an invalid JSON document.
"""
Then I get 400 as response code
And I get "Malformed JSON" as response reason phrase
@@ -1,12 +1,11 @@
Feature: Kapow! server reject responses with semantic errors.
Kapow! server will reject to append routes when
it receives a valid json document but not conforming
with the specification.
Feature: Kapow! server rejects requests with semantic errors.
Kapow! server will refuse to append routes when
it receives a valid json document not conforming
to the specification.
Scenario: Error because of lack of mandatory fields.
If a request lacks of any of the mandatory fields
the server responds with an error indicating the
missing fields.
Scenario: Error because lacking mandatory fields.
If a request lacks any mandatory field the server
responds with an error.
Given I have a running Kapow! server
When I append the route:
@@ -19,7 +18,7 @@ Feature: Kapow! server reject responses with semantic errors.
Then I get 422 as response code
And I get "Invalid Route" as response reason phrase
Scenario: Error because of wrong route specification.
Scenario: Error because bad route format.
If a request contains an invalid expression in the
field url_pattern the server responds with an error.
@@ -1,9 +1,9 @@
Feature: Append new routes in Kapow! server.
Append routes allow users to configure the server. New
routes are added to the list of existing routes.
Appending routes allows users to configure the server. New
routes are added at the end of the list of existing routes.
Scenario: Append the first route.
A fresh server, just started or with all routes removed,
A just started server or one with all routes removed,
will create a new list of routes. The newly created rule
will be at index 0.
@@ -35,7 +35,7 @@ Feature: Append new routes in Kapow! server.
Appending routes on a non empty list will create new routes
at the end of the list.
Given I have a Kapow! server whith the following routes:
Given I have a Kapow! server with the following routes:
| method | url_pattern | entrypoint | command |
| GET | /listRootDir | /bin/sh -c | ls -la / \| response /body |
| GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body |