2021-11-19 18:24:43 +01:00
Feature: Change data of space
2022-07-08 05:18:40 +02:00
As a user with space admin rights
2023-04-20 15:30:13 +05:45
I want to be able to change the meta-data of a created space (increase the quota, change name, etc.)
So that I can manage the spaces
2021-11-19 18:24:43 +01:00
Background:
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2022-07-08 05:18:40 +02:00
| username |
| Alice |
| Brian |
| Bob |
2023-06-15 15:56:48 +02:00
And the administrator has assigned the role " Space Admin " to user " Alice " using the Graph API
2022-07-08 05:18:40 +02:00
And user " Alice " has created a space " Project Jupiter " of type " project " with quota " 20 "
2024-05-09 14:07:56 +05:45
And user " Alice " has sent the following space share invitation:
| space | Project Jupiter |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor |
And user " Alice " has sent the following space share invitation:
| space | Project Jupiter |
| sharee | Bob |
| shareType | user |
| permissionsRole | Space Viewer |
2022-09-14 13:38:15 +05:45
And using spaces DAV path
2021-11-19 18:24:43 +01:00
2022-07-08 05:18:40 +02:00
2023-05-04 18:40:11 +05:45
Scenario: user with space manager role can change the name of a space via the Graph API
When user " Alice " changes the name of the " Project Jupiter " space to " Project Death Star "
Then the HTTP status code should be " 200 "
And the JSON data of the response should match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"driveType"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Death Star"]
},
"driveType": {
"type": "string",
"enum": ["project"]
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2023-05-04 18:40:11 +05:45
Scenario Outline: user other than space manager role can't change the name of a Space via the Graph API
When user " <user> " changes the name of the " Project Jupiter " space to " Project Jupiter "
2025-11-28 09:28:08 +01:00
Then the HTTP status code should be " 403 "
2022-07-08 05:18:40 +02:00
Examples:
2023-05-04 18:40:11 +05:45
| user |
| Brian |
| Bob |
2022-07-08 05:18:40 +02:00
2023-05-04 18:40:11 +05:45
Scenario: user with space manager role can change the description(subtitle) of a space via the Graph API
2022-07-08 05:18:40 +02:00
When user " Alice " changes the description of the " Project Jupiter " space to " The Death Star is a fictional mobile space station "
2021-12-12 17:34:04 +01:00
Then the HTTP status code should be " 200 "
2023-05-04 18:40:11 +05:45
And the JSON data of the response should match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"driveType",
"description"
],
"properties": {
"driveType": {
"type": "string",
"enum": ["project"]
},
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"description": {
"type": "string",
"enum": ["The Death Star is a fictional mobile space station"]
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: viewer and editor cannot change the description(subtitle) of a space via the Graph API
2022-07-08 05:18:40 +02:00
When user " <user> " changes the description of the " Project Jupiter " space to " The Death Star is a fictional mobile space station "
2025-11-28 09:28:08 +01:00
Then the HTTP status code should be " 403 "
2022-07-08 05:18:40 +02:00
Examples:
2023-05-04 18:40:11 +05:45
| user |
| Brian |
| Bob |
2022-07-08 05:18:40 +02:00
2023-05-04 18:40:11 +05:45
Scenario Outline: user with normal space permission can't increase the quota of a Space via the Graph API
2022-07-08 05:18:40 +02:00
When user " <user> " changes the quota of the " Project Jupiter " space to " 100 "
2023-05-04 18:40:11 +05:45
Then the HTTP status code should be " 403 "
2022-07-08 05:18:40 +02:00
Examples:
2023-05-04 18:40:11 +05:45
| user |
| Brian |
| Bob |
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: space admin user set no restriction quota of a Space via the Graph API
2024-03-21 09:14:50 +05:45
When user " Alice " changes the quota of the " Project Jupiter " space to " <quota-value> "
2021-12-12 17:34:04 +01:00
Then the HTTP status code should be " 200 "
2023-05-04 18:40:11 +05:45
And the JSON data of the response should match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"quota"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"quota": {
"type": "object",
"required": [
"used",
"total"
],
"properties": {
"used" : {
"type": "number",
"enum": [0]
},
"total" : {
"type": "number",
"enum": [0]
}
2023-03-15 10:06:58 +05:45
}
}
}
}
2024-06-10 11:49:27 +05:45
"""
2022-07-08 05:18:40 +02:00
Examples:
2024-03-21 09:14:50 +05:45
| quota-value |
| 0 |
| -1 |
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario: user space admin set readme file as description of the space via the Graph API
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
And user " Alice " has uploaded a file inside space " Project Jupiter " with content " space description " to " .space/readme.md "
When user " Alice " sets the file " .space/readme.md " as a description in a special section of the " Project Jupiter " space
2022-03-10 09:29:26 +01:00
Then the HTTP status code should be " 200 "
2023-05-04 18:40:11 +05:45
And the JSON response should contain space called " Project Jupiter " owned by " Alice " with description file " .space/readme.md " and match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"special"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"special": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"size",
"name",
"specialFolder",
"file",
"id",
"eTag"
],
"properties": {
"size": {
"type": "number",
"enum": [17]
},
"name": {
"type": "string",
"enum": ["readme.md"]
},
"specialFolder": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": ["readme"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"file": {
"type": "object",
"required": [
"mimeType"
],
"properties": {
"mimeType": {
"type": "string",
"enum": ["text/markdown"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"id": {
"type": "string",
"enum": ["%file_id%"]
},
"tag": {
"type": "string",
"enum": ["%eTag%"]
2023-03-15 10:06:58 +05:45
}
}
}
2024-02-23 16:24:22 +05:45
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2022-07-08 05:18:40 +02:00
And for user " Alice " the content of the file " .space/readme.md " of the space " Project Jupiter " should be " space description "
2023-04-17 17:05:12 +05:45
Scenario Outline: user member of the space changes readme file
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
And user " Alice " has uploaded a file inside space " Project Jupiter " with content " space description " to " .space/readme.md "
And user " Alice " has set the file " .space/readme.md " as a description in a special section of the " Project Jupiter " space
When user " <user> " uploads a file inside space " Project Jupiter " with content " new description " to " .space/readme.md " using the WebDAV API
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
2022-07-08 05:18:40 +02:00
And for user " <user> " the content of the file " .space/readme.md " of the space " Project Jupiter " should be " <content> "
Examples:
2024-03-21 09:14:50 +05:45
| user | http-status-code | content |
| Brian | 204 | new description |
| Bob | 403 | space description |
2022-03-10 09:29:26 +01:00
2023-04-17 17:05:12 +05:45
Scenario Outline: user space admin and editor set image file as space image of the space via the Graph API
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
2024-03-21 09:14:50 +05:45
And user " <user> " has uploaded a file inside space " Project Jupiter " with content "" to " .space/ <file-name> "
When user " <user> " sets the file " .space/ <file-name> " as a space image in a special section of the " Project Jupiter " space
2022-03-10 09:29:26 +01:00
Then the HTTP status code should be " 200 "
2024-03-21 09:14:50 +05:45
And the JSON response should contain space called " Project Jupiter " owned by " Alice " with description file " .space/ <file-name> " and match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"special"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"special": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"size",
"name",
"specialFolder",
"file",
"id",
"eTag"
],
"properties": {
"size": {
"type": "number",
"enum": [0]
},
"name": {
"type": "string",
"enum": [" <file-name> "]
},
"specialFolder": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": ["image"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"file": {
"type": "object",
"required": [
"mimeType"
],
"properties": {
"mimeType": {
"type": "string",
"enum": [" <mime-type> "]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"id": {
"type": "string",
"enum": ["%file_id%"]
},
"tag": {
"type": "string",
"enum": ["%eTag%"]
2023-03-15 10:06:58 +05:45
}
}
}
2024-02-23 16:24:22 +05:45
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2022-07-08 05:18:40 +02:00
And for user " <user> " folder " .space/ " of the space " Project Jupiter " should contain these entries:
2024-03-21 09:14:50 +05:45
| <file-name> |
2022-03-10 09:29:26 +01:00
Examples:
2024-03-21 09:14:50 +05:45
| user | file-name | mime-type |
| Alice | spaceImage.jpeg | image/jpeg |
| Brian | spaceImage.png | image/png |
| Alice | spaceImage.gif | image/gif |
2022-07-08 05:18:40 +02:00
2024-06-10 11:49:27 +05:45
2023-04-17 17:05:12 +05:45
Scenario: user viewer cannot set image file as space image of the space via the Graph API
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
And user " Alice " has uploaded a file inside space " Project Jupiter " with content "" to " .space/someImageFile.jpg "
When user " Bob " sets the file " .space/someImageFile.jpg " as a space image in a special section of the " Project Jupiter " space
2025-11-28 09:28:08 +01:00
Then the HTTP status code should be " 403 "
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: user set new readme file as description of the space via the graph API
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
And user " Alice " has uploaded a file inside space " Project Jupiter " with content " space description " to " .space/readme.md "
And user " Alice " has set the file " .space/readme.md " as a description in a special section of the " Project Jupiter " space
When user " <user> " uploads a file inside space " Project Jupiter " owned by the user " Alice " with content " new content " to " .space/readme.md " using the WebDAV API
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
And for user " <user> " the content of the file " .space/readme.md " of the space " Project Jupiter " should be " <expected-content> "
2023-10-30 17:57:42 +05:45
When user " <user> " lists all available spaces via the Graph API
2023-05-04 18:40:11 +05:45
And the JSON response should contain space called " Project Jupiter " owned by " Alice " with description file " .space/readme.md " and match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"special"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"special": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"size",
"name",
"specialFolder",
"file",
"id",
"eTag"
],
"properties": {
"size": {
"type": "number",
"enum": [ <expected-size> ]
},
"name": {
"type": "string",
"enum": ["readme.md"]
},
"specialFolder": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": ["readme"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"file": {
"type": "object",
"required": [
"mimeType"
],
"properties": {
"mimeType": {
"type": "string",
"enum": ["text/markdown"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"id": {
"type": "string",
"enum": ["%file_id%"]
},
"tag": {
"type": "string",
"enum": ["%eTag%"]
2023-03-15 10:06:58 +05:45
}
}
}
2024-02-23 16:24:22 +05:45
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2022-07-08 05:18:40 +02:00
Examples:
2024-03-21 09:14:50 +05:45
| user | http-status-code | expected-size | expected-content |
| Alice | 204 | 11 | new content |
| Brian | 204 | 11 | new content |
| Bob | 403 | 17 | space description |
2022-07-08 05:18:40 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: user set new image file as space image of the space via the Graph API
2022-07-08 05:18:40 +02:00
Given user " Alice " has created a folder " .space " in space " Project Jupiter "
And user " Alice " has uploaded a file inside space " Project Jupiter " with content "" to " .space/spaceImage.jpeg "
And user " Alice " has set the file " .space/spaceImage.jpeg " as a space image in a special section of the " Project Jupiter " space
2023-10-17 11:41:47 +05:45
When user " <user> " uploads a file inside space " Project Jupiter " with content "" to " .space/newSpaceImage.png " using the WebDAV API
2022-07-08 05:18:40 +02:00
And user " <user> " sets the file " .space/newSpaceImage.png " as a space image in a special section of the " Project Jupiter " space
2022-05-19 11:05:36 +02:00
Then the HTTP status code should be " 200 "
2023-05-04 18:40:11 +05:45
And the JSON response should contain space called " Project Jupiter " owned by " Alice " with description file " .space/newSpaceImage.png " and match
2024-06-10 11:49:27 +05:45
"""
{
"type": "object",
"required": [
"name",
"special"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project Jupiter"]
},
"special": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"size",
"name",
"specialFolder",
"file",
"id",
"eTag"
],
"properties": {
"size": {
"type": "number",
"enum": [0]
},
"name": {
"type": "string",
"enum": ["newSpaceImage.png"]
},
"specialFolder": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": ["image"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"file": {
"type": "object",
"required": [
"mimeType"
],
"properties": {
"mimeType": {
"type": "string",
"enum": ["image/png"]
}
2023-03-15 10:06:58 +05:45
}
2024-06-10 11:49:27 +05:45
},
"id": {
"type": "string",
"enum": ["%file_id%"]
},
"tag": {
"type": "string",
"enum": ["%eTag%"]
2023-03-15 10:06:58 +05:45
}
}
}
2024-02-23 16:24:22 +05:45
}
2023-03-15 10:06:58 +05:45
}
}
2024-06-10 11:49:27 +05:45
"""
2022-05-19 11:05:36 +02:00
Examples:
2022-07-08 05:18:40 +02:00
| user |
| Alice |
2022-08-04 13:11:51 +02:00
| Brian |
2023-05-04 18:40:11 +05:45
Scenario Outline: user can't upload resource greater than set quota
2024-03-21 09:14:50 +05:45
Given the administrator has assigned the role " <user-role> " to user " Alice " using the Graph API
2025-02-12 16:17:23 +05:45
And user " Admin " has changed the quota of space " Alice Hansen " to " 15 "
2023-05-04 18:40:11 +05:45
When user " Alice " uploads a file inside space " Alice Hansen " with content " file is more than 15 bytes " to " file.txt " using the WebDAV API
Then the HTTP status code should be " 507 "
And for user " Alice " the space " Personal " should not contain these entries:
| file.txt |
2024-03-21 09:14:50 +05:45
Examples:
| user-role |
| Admin |
| Space Admin |
| User |
| User Light |
2023-05-04 18:40:11 +05:45
Scenario Outline: admin user set own quota of a personal space via the Graph API and upload resource
2024-03-21 09:14:50 +05:45
When user " Admin " changes the quota of the " Admin " space to " <quota-value> "
2022-08-04 13:11:51 +02:00
Then the HTTP status code should be " 200 "
When user " Admin " uploads a file inside space " Admin " with content " file is more than 15 bytes " to " file.txt " using the WebDAV API
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be <http-status-code>
2023-05-04 18:40:11 +05:45
And for user " Admin " the space " Personal " should contain these entries:
| file.txt |
2022-08-04 13:11:51 +02:00
Examples:
2024-03-21 09:14:50 +05:45
| quota-value | http-status-code |
| 10000 | between "201" and "204" |
| 0 | between "201" and "204" |
| -1 | between "201" and "204" |
2022-08-04 13:11:51 +02:00
2023-05-04 18:40:11 +05:45
Scenario Outline: admin user set an user personal space quota of via the Graph API and upload resource
2024-03-21 09:14:50 +05:45
When user " Admin " changes the quota of the " Brian Murphy " space to " <quota-value> "
2022-08-04 13:11:51 +02:00
Then the HTTP status code should be " 200 "
When user " Brian " uploads a file inside space " Brian Murphy " with content " file is more than 15 bytes " to " file.txt " using the WebDAV API
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be <http-status-code>
2023-05-04 18:40:11 +05:45
And for user " Brian " the space " Personal " should contain these entries:
| file.txt |
2022-08-04 13:11:51 +02:00
Examples:
2024-03-21 09:14:50 +05:45
| quota-value | http-status-code |
| 10000 | between "201" and "204" |
| 0 | between "201" and "204" |
| -1 | between "201" and "204" |
2023-01-04 17:00:59 +05:45
2023-01-04 12:11:09 +05:45
2023-04-17 17:05:12 +05:45
Scenario: user sends invalid space uuid via the graph API
2023-01-04 17:00:59 +05:45
When user " Admin " tries to change the name of the " non-existing " space to " new name "
Then the HTTP status code should be " 404 "
When user " Admin " tries to change the quota of the " non-existing " space to " 10 "
Then the HTTP status code should be " 404 "
When user " Alice " tries to change the description of the " non-existing " space to " new description "
Then the HTTP status code should be " 404 "
2023-01-04 12:11:09 +05:45
Scenario: user sends PATCH request to other user's space that they don't have access to
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2023-01-04 12:11:09 +05:45
| username |
| Carol |
When user " Carol " sends PATCH request to the space " Personal " of user " Alice " with data " {} "
Then the HTTP status code should be " 404 "
When user " Carol " sends PATCH request to the space " Project Jupiter " of user " Alice " with data " {} "
Then the HTTP status code should be " 404 "
2024-10-17 10:15:04 +05:45
@env-config
Scenario Outline: space member with role 'Space Editor Without Versions' and Space Editor edits the space
Given the administrator has enabled the permissions role " Space Editor Without Versions "
2024-11-29 09:39:21 +05:45
And these users have been created with default attributes:
2024-10-17 10:15:04 +05:45
| username |
| Carol |
And user " Alice " has sent the following space share invitation:
| space | Project Jupiter |
| sharee | Carol |
| shareType | user |
| permissionsRole | <role> |
When user " Carol " creates a folder " .space " in space " Project Jupiter " using the WebDav Api
Then the HTTP status code should be " 201 "
When user " Carol " uploads a file inside space " Project Jupiter " with content " hello " to " .space/readme.md " using the WebDAV API
Then the HTTP status code should be " 201 "
When user " Carol " sets the file " .space/readme.md " as a description in a special section of the " Project Jupiter " space
Then the HTTP status code should be " 200 "
When user " Carol " removes the folder " .space " from space " Project Jupiter "
Then the HTTP status code should be " 204 "
Examples:
| role |
| Space Editor Without Versions |
2026-01-02 16:41:38 +05:45
| Space Editor |
@issue-11887
Scenario: space manager tries to change the name of a space to an empty string
When user " Alice " changes the name of the " Project Jupiter " space to ""
Then the HTTP status code should be " 400 "