Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API test for removeSubAdmin #31390

Merged
merged 1 commit into from
May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"