Skip to content

Commit

Permalink
API test for removeSubAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
paurakhsharma committed May 8, 2018
1 parent ca2d051 commit f52cdeb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,33 @@ So that I cam manage administrative access rights for groups
Background:
Given using API version "1"

Scenario: Removing subadmin from a group
Scenario: Removing subadmin from a group
Given user "brand-new-user" has been created
And group "new-group" has been created
And user "brand-new-user" has been made a subadmin of group "new-group"
When user "admin" sends HTTP method "DELETE" to API endpoint "/cloud/users/brand-new-user/subadmins" with body
| groupid | 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 tries to remove other subadmin in the group
Given 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 "newsubadmin" has been created
And user "newsubadmin" has been made a subadmin of group "new-group"
When user "subadmin" sends HTTP method "DELETE" to API endpoint "/cloud/users/newsubadmin/subadmins" with body
| groupid | new-group |
Then the OCS status code should be "997"
And the HTTP status code should be "401"

Scenario: normal user tries to remove subadmin in the group
Given user "subadmin" has been created
And user "newuser" has been created
And group "new-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
And user "newuser" has been added to group "new-group"
When user "newuser" sends HTTP method "DELETE" to API endpoint "/cloud/users/subadmin/subadmins" with body
| groupid | new-group |
Then the OCS status code should be "997"
And the HTTP status code should be "401"
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,35 @@ So that I cam manage administrative access rights for groups
Background:
Given using API version "2"

Scenario: Removing subadmin from a group
Scenario: Removing subadmin from a group
Given user "brand-new-user" has been created
And group "new-group" has been created
And user "brand-new-user" has been made a subadmin of group "new-group"
When user "admin" sends HTTP method "DELETE" to API endpoint "/cloud/users/brand-new-user/subadmins" with body
| groupid | 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"

@skip @issue-31276
Scenario: subadmin tries to remove other subadmin in the group
Given 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 "newsubadmin" has been created
And user "newsubadmin" has been made a subadmin of group "new-group"
When user "subadmin" sends HTTP method "DELETE" to API endpoint "/cloud/users/newsubadmin/subadmins" with body
| groupid | new-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 remove subadmin in the group
Given user "subadmin" has been created
And user "newuser" has been created
And group "new-group" has been created
And user "subadmin" has been made a subadmin of group "new-group"
And user "newuser" has been added to group "new-group"
When user "newuser" sends HTTP method "DELETE" to API endpoint "/cloud/users/subadmin/subadmins" with body
| groupid | new-group |
Then the OCS status code should be "997"
And the HTTP status code should be "401"

0 comments on commit f52cdeb

Please sign in to comment.