Skip to content

Commit 8d5e730

Browse files
Merge pull request #15 from cedricduffournet/behat_test
Add behat test for civility resource
2 parents 49049d7 + f03b909 commit 8d5e730

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/src/Features/civility.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ Feature: Provide a consistent standard JSON API endpoint
107107
When I request "/api/civilities/2" using HTTP GET
108108
Then the response code is 404
109109

110+
Scenario: Cannot delete a Civility linked to user
111+
Given I am successfully logged in with username: "[email protected]", password: "adminpwd" and grantType: "password"
112+
When I request "/api/civilities/1" using HTTP DELETE
113+
Then the response code is 400
114+
115+
Scenario: Cannot add a new Civility is code is longer than 10 characters
116+
Given I am successfully logged in with username: "[email protected]", password: "adminpwd" and grantType: "password"
117+
When the request body is:
118+
"""
119+
{
120+
"name": "New civility",
121+
"code": "code longer than 10 characters"
122+
}
123+
"""
124+
And I request "/api/civilities" using HTTP POST
125+
Then the response code is 400
126+
110127
Scenario: Reader cannot add a new Civility
111128
Given I am successfully logged in with username: "[email protected]", password: "readerpwd" and grantType: "password"
112129
And I request "/api/civilities" using HTTP POST

0 commit comments

Comments
 (0)