File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Redmine \Tests \Behat \Bootstrap ;
6
6
7
+ use Redmine \Api \Role ;
8
+
7
9
trait RoleContextTrait
8
10
{
9
11
/**
@@ -28,4 +30,18 @@ public function iHaveARoleWithTheName($name)
28
30
],
29
31
);
30
32
}
33
+
34
+ /**
35
+ * @When I list all roles
36
+ */
37
+ public function iListAllRoles ()
38
+ {
39
+ /** @var Role */
40
+ $ api = $ this ->getNativeCurlClient ()->getApi ('role ' );
41
+
42
+ $ this ->registerClientResponse (
43
+ $ api ->list (),
44
+ $ api ->getLastResponse (),
45
+ );
46
+ }
31
47
}
Original file line number Diff line number Diff line change
1
+ @role
2
+ Feature : Interacting with the REST API for roles
3
+ In order to interact with REST API for roles
4
+ As a user
5
+ I want to make sure the Redmine server replies with the correct response
6
+
7
+ Scenario : Listing of zero roles
8
+ Given I have a "NativeCurlClient" client
9
+ When I list all roles
10
+ Then the response has the status code "200"
11
+ And the response has the content type "application/json"
12
+ And the returned data has only the following properties
13
+ """
14
+ roles
15
+ """
16
+ And the returned data "roles" property is an array
17
+ And the returned data "roles" property contains "0" items
18
+
19
+ Scenario : Listing of multiple roles
20
+ Given I have a "NativeCurlClient" client
21
+ And I have a role with the name "Reporter"
22
+ And I have a role with the name "Developer"
23
+ When I list all roles
24
+ Then the response has the status code "200"
25
+ And the response has the content type "application/json"
26
+ And the returned data has only the following properties
27
+ """
28
+ roles
29
+ """
30
+ And the returned data "roles" property is an array
31
+ And the returned data "roles" property contains "2" items
32
+ And the returned data "roles.0" property contains "2" items
33
+ And the returned data "roles.0" property contains the following data
34
+ | property | value |
35
+ | id | 3 |
36
+ | name | Reporter |
37
+ And the returned data "roles.1" property contains "2" items
38
+ And the returned data "roles.1" property contains the following data
39
+ | property | value |
40
+ | id | 4 |
41
+ | name | Developer |
You can’t perform that action at this time.
0 commit comments