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

[tests-only][full-ci]Extend tests coverage for different role capability for spaces #5853

Merged
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 @@ -139,5 +139,12 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiGraph/addUserToGroup.feature:292](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/addUserToGroup.feature#L292)
- [apiGraph/addUserToGroup.feature:306](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/addUserToGroup.feature#L306)

#### [Admin user can't restore other user spaces](https://github.com/owncloud/ocis/issues/5872)
- [apiSpaces/restoreSpaces.feature:94](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/restoreSpaces.feature#L94)

#### [https://github.com/owncloud/ocis/issues/5938](https://github.com/owncloud/ocis/issues/5938)
- [apiSpaces/createSpace.feature:18](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/createSpace.feature#L18)
- [apiSpaces/createSpace.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/createSpace.feature#L19)

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.
156 changes: 156 additions & 0 deletions tests/acceptance/features/apiSpaces/createSpace.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
@api
Feature: create space
As an admin and space admin
I want to create new spaces
So that I can organize a set of resources in a hierarchical tree

Background:
Given user "Alice" has been created with default attributes and without skeleton files


Scenario Outline: user with role user and guest can't create Space via Graph API
Given the administrator has given "Alice" the role "<role>" using the settings api
When user "Alice" tries to create a space "Project Mars" of type "project" with the default quota using the Graph API
Then the HTTP status code should be "403"
And the user "Alice" should not have a space called "share space"
Examples:
| role |
| User |
| Guest |


Scenario Outline: an admin or space admin user can create a Space via the Graph API with a default quota
Given the administrator has given "Alice" the role "<role>" using the settings api
When user "Alice" creates a space "Project Mars" of type "project" with the default quota using the Graph API
Then the HTTP status code should be "201"
And the JSON response should contain space called "Project Mars" and match
"""
{
"type": "object",
"required": [
"driveType",
"driveAlias",
"name",
"id",
"quota",
"root",
"webUrl"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Mars"]
},
"driveType": {
"type": "string",
"enum": ["project"]
},
"driveAlias": {
"type": "string",
"enum": ["project/project-mars"]
},
"id": {
"type": "string",
"enum": ["%space_id%"]
},
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"state": {
"type": "number",
"enum": [1000000000]
}
}
},
"root": {
"type": "object",
"required": [
"webDavUrl"
],
"properties": {
"webDavUrl": {
"type": "string",
"enum": ["%base_url%/dav/spaces/%space_id%"]
}
}
},
"webUrl": {
"type": "string",
"enum": ["%base_url%/f/%space_id%"]
}
}
}
"""
Examples:
| role |
| Admin |
| Space Admin |


Scenario Outline: an admin or space admin user can create a Space via the Graph API with certain quota
Given the administrator has given "Alice" the role "<role>" using the settings api
When user "Alice" creates a space "Project Venus" of type "project" with quota "2000" using the Graph API
Then the HTTP status code should be "201"
And the JSON response should contain space called "Project Venus" and match
"""
{
"type": "object",
"required": [
"driveType",
"name",
"id",
"quota",
"root",
"webUrl"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Venus"]
},
"driveType": {
"type": "string",
"enum": ["project"]
},
"id": {
"type": "string",
"enum": ["%space_id%"]
},
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"state": {
"type": "number",
"enum": [2000]
}
}
},
"root": {
"type": "object",
"required": [
"webDavUrl"
],
"properties": {
"webDavUrl": {
"type": "string",
"enum": ["%base_url%/dav/spaces/%space_id%"]
}
}
},
"webUrl": {
"type": "string",
"enum": ["%base_url%/f/%space_id%"]
}
}
}
"""
Examples:
| role |
| Admin |
| Space Admin |
130 changes: 0 additions & 130 deletions tests/acceptance/features/apiSpaces/deleteSpaces.feature

This file was deleted.

Loading