Refactoring of cucumber implementation

This commit is contained in:
2019-08-23 13:04:20 +02:00
parent 46885ac599
commit 9b6f3aab88
14 changed files with 259 additions and 189 deletions

View File

@@ -1,11 +1,11 @@
Feature: articles routes
Scenario: The route for get articles must response a 200
When I send a "GET" request to "/articles"
When I send a GET request to "/articles"
Then the response status code should be 200
Scenario: The route for get one article must response a 200 and return article
When I send a "GET" request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
When I send a GET request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
Then the response status code should be 200
And the response should contain object:
| id | 9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b |
@@ -15,7 +15,8 @@ Feature: articles routes
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "POST" request to "/articles" with body:
And I am authenticated as an user
When I send a POST request to "/articles" with body:
"""
{
"version_id": "09c418b6-63ba-448b-b38b-502b41cd500e",

View File

@@ -1,11 +1,11 @@
Feature: citizens routes
Scenario: The route for get citizens must response a 200
When I send a "GET" request to "/citizens"
When I send a GET request to "/citizens"
Then the response status code should be 200
Scenario: The route for get one citizen must response a 200 and return citizen
When I send a "GET" request to "/citizens/6434f4f9-f570-f22a-c134-8668350651ff"
When I send a GET request to "/citizens/6434f4f9-f570-f22a-c134-8668350651ff"
Then the response status code should be 200
And the response should contain object:
| id | 6434f4f9-f570-f22a-c134-8668350651ff |

View File

@@ -1,11 +1,11 @@
Feature: constitution routes
Scenario: The route for get constitutions must response a 200
When I send a "GET" request to "/constitutions"
When I send a GET request to "/constitutions"
Then the response status code should be 200
Scenario: The route for get one constitution must response a 200 and return constitution
When I send a "GET" request to "/constitutions/0ca489a6-ef68-8bd5-2355-5793d4b3d66c"
When I send a GET request to "/constitutions/0ca489a6-ef68-8bd5-2355-5793d4b3d66c"
Then the response status code should be 200
And the response should contain object:
| id | 0ca489a6-ef68-8bd5-2355-5793d4b3d66c |
@@ -15,7 +15,7 @@ Feature: constitution routes
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "POST" request to "/constitutions" with body:
When I send a POST request to "/constitutions" with body:
"""
{
"version_id":"15814bb6-8d90-4c6a-a456-c3939a8ec75e",

View File

@@ -6,7 +6,7 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "POST" request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/follow"
When I send a POST request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/follow"
Then the response status code should be 201
Scenario: The route for get follows of articles must response a 200 and return objects
@@ -14,7 +14,7 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "GET" request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/follows/articles"
When I send a GET request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/follows/articles"
Then the response status code should be 200
And the response should contain object:
| current_page | 1 |
@@ -25,7 +25,7 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "DELETE" request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/follow"
When I send a DELETE request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/follow"
Then the response status code should be 204
# Constitution
@@ -34,7 +34,7 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "POST" request to "/constitutions/72aa1ee1-4963-eb44-c9e0-5ce6e0f18f00/follow"
When I send a POST request to "/constitutions/72aa1ee1-4963-eb44-c9e0-5ce6e0f18f00/follow"
Then the response status code should be 201
Scenario: The route for get follows of constitutions must response a 200 and return objects
@@ -42,7 +42,7 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "GET" request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/follows/constitutions"
When I send a GET request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/follows/constitutions"
Then the response status code should be 200
And the response should contain object:
| current_page | 1 |
@@ -53,5 +53,5 @@ Feature: follow Article and Constitution
| id | 64b7b379-2298-43ec-b428-ba134930cabd |
| firstName | Jaque |
| lastName | Dupuis |
When I send a "DELETE" request to "/constitutions/72aa1ee1-4963-eb44-c9e0-5ce6e0f18f00/follow"
When I send a DELETE request to "/constitutions/72aa1ee1-4963-eb44-c9e0-5ce6e0f18f00/follow"
Then the response status code should be 204