Skip to content

Commit

Permalink
removed duplicate scenarios for set quota
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya committed Mar 31, 2023
1 parent b4c5e3a commit 6f4f690
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,9 @@ The expected failures in this file are from features in the owncloud/ocis repo.
### [Adding the same user as multiple members in a single request results in listing the same user twice in the group](https://github.com/owncloud/ocis/issues/5855)
- [apiGraph/addUserToGroup.feature:367](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/addUserToGroup.feature#L367)

### [API requests from an unauthorized user should return 403](https://github.com/owncloud/ocis/issues/5938)
- [apiSpaces/setQuota.feature:50](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L50)
- [apiSpaces/setQuota.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L134)
- [apiSpaces/setQuota.feature:210](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L210)
Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.
12 changes: 6 additions & 6 deletions tests/acceptance/features/apiSpaces/setQuota.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Feature: Set quota
| User |
| Guest |


@issue-5938
Scenario Outline: non-admin user tries to set the personal space quota of other users
Given the administrator has given "Alice" the role "<role>" using the settings api
And the administrator has given "Brian" the role "<userRole>" using the settings api
When user "Alice" changes the quota of the "Brian Murphy" space to "100" owned by user "Brian"
Then the HTTP status code should be "401"
Then the HTTP status code should be "403"
And for user "Brian" the JSON response should contain space called "Brian Murphy" and match
"""
{
Expand Down Expand Up @@ -130,7 +130,7 @@ Feature: Set quota
| Admin |
| Space Admin |


@issue-5938
Scenario Outline: normal or guest user tries to set quota of a space
Given the administrator has given "Alice" the role "Space Admin" using the settings api
And the administrator has given "Brian" the role "<userRole>" using the settings api
Expand All @@ -139,7 +139,7 @@ Feature: Set quota
| shareWith | Brian |
| role | <spaceRole> |
When user "Brian" changes the quota of the "Project Jupiter" space to "100"
Then the HTTP status code should be "401"
Then the HTTP status code should be "403"
And for user "Alice" the JSON response should contain space called "Project Jupiter" and match
"""
{
Expand Down Expand Up @@ -206,11 +206,11 @@ Feature: Set quota
}
"""


@issue-5938
Scenario Outline: non-admin user tries to set their own personal space quota
Given the administrator has given "Alice" the role "<userRole>" using the settings api
When user "Alice" changes the quota of the "Alice Hansen" space to "100" owned by user "Alice"
Then the HTTP status code should be "401"
Then the HTTP status code should be "403"
And for user "Alice" the JSON response should contain space called "Alice Hansen" and match
"""
{
Expand Down
112 changes: 0 additions & 112 deletions tests/acceptance/features/apiSpaces/spaceManagement.feature
Original file line number Diff line number Diff line change
Expand Up @@ -89,118 +89,6 @@ Feature: Space management
And the json responded should not contain a space with name "Project"
And the json responded should not contain a space with name "Alice Hansen"


Scenario: The space admin user changes the quota of the project space
When user "Brian" changes the quota of the "Project" space to "20" owned by user "Alice"
Then the HTTP status code should be "200"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total": {
"type": "number",
"enum": [20]
}
}
}
}
}
"""


Scenario: The user without space admin permissions tries to change the quota of the project space
When user "Carol" tries to change the quota of the "Project" space to "20" owned by user "Alice"
Then the HTTP status code should be "401"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total": {
"type": "number",
"enum": [10]
}
}
}
}
}
"""


Scenario: The space admin user tries to change the quota of the personal space
When user "Brian" tries to change the quota of the "Alice Hansen" space to "20" owned by user "Alice"
Then the HTTP status code should be "401"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total": {
"type": "number",
"enum": [10]
}
}
}
}
}
"""


Scenario: The user without space admin permissions tries to change the quota of the personal space
When user "Carol" tries to change the quota of the "Alice Hansen" space to "20" owned by user "Alice"
Then the HTTP status code should be "401"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total": {
"type": "number",
"enum": [10]
}
}
}
}
}
"""

@skipOnStable2.0
Scenario: The space admin user changes the name of the project space
When user "Brian" changes the name of the "Project" space to "New Name" owned by user "Alice"
Expand Down

0 comments on commit 6f4f690

Please sign in to comment.