Fix comment test

This commit is contained in:
2019-10-01 13:55:41 +02:00
parent 47bdc349c5
commit 70c69bd626
2 changed files with 11 additions and 9 deletions

View File

@@ -1,15 +1,17 @@
Feature: comment Article
Scenario: The route for comment article must response a 201 and return object
Scenario: Can comment an article
Given I am authenticated as John Doe with id "64b7b379-2298-43ec-b428-ba134930cabd"
And I have article with id "9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
When I send a POST request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/comments" with body:
"""
Hello mister
{
"content": "Hello mister"
}
"""
Then the response status code should be 201
Scenario: The route for get comments of articles for the current citizen must response a 200 and return objects
Scenario: Can get comments on articles of the current citizen
Given I have citizen John Doe with id "64b7b379-2298-43ec-b428-ba134930cabd"
And I have article with id "9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
When I send a GET request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/comments/articles"
@@ -18,7 +20,7 @@ Feature: comment Article
| current_page | 1 |
| limit | 50 |
Scenario: The route for edit comment must response a 200 and return object
Scenario: Can edit a comment
Given I am authenticated as username 3 with id "92877af7-0a45-fd6a-2ed7-fe81e1236b78"
When I send a PUT request to "/comments/2f01c257-cf20-3466-fb10-a3b8eff12a97" with body:
"""
@@ -28,7 +30,7 @@ Feature: comment Article
And the JSON should contain:
| content | Hello boy |
Scenario: The route for get comment must response a 200 and return object
Scenario: Can get comment by its ID
When I send a GET request to "/comments/2f01c257-cf20-3466-fb10-a3b8eff12a97"
Then the response status code should be 200
And the JSON should contain:

View File

@@ -1,6 +1,6 @@
Feature: comment Constitution
Scenario: The route for comment constitution must response a 201 and return object
Scenario: Can comment an constitution
Given I am authenticated as John Doe with id "64b7b379-2298-43ec-b428-ba134930cabd"
And I have constitution with id "9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
When I send a POST request to "/constitutions/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/comments" with body:
@@ -9,7 +9,7 @@ Feature: comment Constitution
"""
Then the response status code should be 201
Scenario: The route for get comments of constitutions for the current citizen must response a 200 and return objects
Scenario: Can get comments on constitution of the current citizen
Given I have citizen John Doe with id "64b7b379-2298-43ec-b428-ba134930cabd"
And I have constitution with id "9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b"
When I send a GET request to "/citizens/64b7b379-2298-43ec-b428-ba134930cabd/comments/constitutions"
@@ -18,7 +18,7 @@ Feature: comment Constitution
| current_page | 1 |
| limit | 50 |
Scenario: The route for edit comment must response a 200 and return object
Scenario: Can edit a comment
Given I am authenticated as username 3 with id "92877af7-0a45-fd6a-2ed7-fe81e1236b78"
When I send a PUT request to "/comments/b0422e48-687f-bea7-b45f-b6b301246e97" with body:
"""
@@ -28,7 +28,7 @@ Feature: comment Constitution
And the JSON should contain:
| content | Hello boy |
Scenario: The route for get comment must response a 200 and return object
Scenario: Can get comment by its ID
When I send a GET request to "/comments/b0422e48-687f-bea7-b45f-b6b301246e97"
Then the response status code should be 200
And the JSON should contain: