Skip to content

Commit

Permalink
Merge pull request #31365 from paurakhsharma/API-test-getGroup
Browse files Browse the repository at this point in the history
API test for getGroup
  • Loading branch information
phil-davis authored May 7, 2018
2 parents b5cd48d + 496ab8b commit 1764fb3
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
33 changes: 32 additions & 1 deletion tests/acceptance/features/apiProvisioning-v1/getGroup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,35 @@ So that I can know which users are in a group
Given group "new-group" has been created
When user "admin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the HTTP status code should be "200"

Scenario: subadmin gets users in a group he is responsible for
Given user "user1" has been created
And user "user2" has been created
And user "subadmin" has been created
And group "new-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
And user "user1" has been added to group "new-group"
And user "user2" has been added to group "new-group"
When user "subadmin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the users returned by the API should be
| user1 |
| user2 |

Scenario: subadmin tries to get users in a group he is not responsible for
Given user "subadmin" has been created
And group "new-group" has been created
And group "another-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
When user "subadmin" sends HTTP method "GET" to API endpoint "/cloud/groups/another-group"
Then the OCS status code should be "997"
And the HTTP status code should be "401"

Scenario: normal user tries to get users in his group
Given user "newuser" has been created
And group "new-group" has been created
When user "newuser" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "997"
And the HTTP status code should be "401"
35 changes: 34 additions & 1 deletion tests/acceptance/features/apiProvisioning-v2/getGroup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,37 @@ So that I can know which users are in a group
Given group "new-group" has been created
When user "admin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "200"
And the HTTP status code should be "200"
And the HTTP status code should be "200"

Scenario: subadmin gets users in a group he is responsible for
Given user "user1" has been created
And user "user2" has been created
And user "subadmin" has been created
And group "new-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
And user "user1" has been added to group "new-group"
And user "user2" has been added to group "new-group"
When user "subadmin" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "200"
And the HTTP status code should be "200"
And the users returned by the API should be
| user1 |
| user2 |

@skip @issue-31276
Scenario: subadmin tries to get users in a group he is not responsible for
Given user "subadmin" has been created
And group "new-group" has been created
And group "another-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
When user "subadmin" sends HTTP method "GET" to API endpoint "/cloud/groups/another-group"
Then the OCS status code should be "401"
And the HTTP status code should be "401"

@skip @issue-31276
Scenario: normal user tries to get users in his group
Given user "newuser" has been created
And group "new-group" has been created
When user "newuser" sends HTTP method "GET" to API endpoint "/cloud/groups/new-group"
Then the OCS status code should be "401"
And the HTTP status code should be "401"

0 comments on commit 1764fb3

Please sign in to comment.