Skip to content

Commit

Permalink
add tests for move rename file between personal and project space wit…
Browse files Browse the repository at this point in the history
…h file-id
  • Loading branch information
nabim777 committed Oct 19, 2023
1 parent fbfb1a0 commit 2b5bf97
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ default:
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
- WebDavPropertiesContext:

extensions:
rdx\behatvars\BehatVariablesExtension: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ Feature: moving/renaming file using file id


Scenario Outline: move a file into a folder inside project space
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has created a folder "/folder" in space "project-space"
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt"
Expand All @@ -94,8 +93,7 @@ Feature: moving/renaming file using file id


Scenario Outline: move a file into a sub-folder inside project space
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has created a folder "folder/sub-folder" in space "project-space"
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "/textfile.txt"
Expand All @@ -113,8 +111,7 @@ Feature: moving/renaming file using file id


Scenario Outline: move a file from folder to root inside project space
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has created a folder "folder" in space "project-space"
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "folder/textfile.txt"
Expand All @@ -132,8 +129,7 @@ Feature: moving/renaming file using file id


Scenario Outline: move a file from sub-folder to root inside project space
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has created a folder "folder/sub-folder" in space "project-space"
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "folder/sub-folder/textfile.txt"
Expand Down Expand Up @@ -229,3 +225,75 @@ Feature: moving/renaming file using file id
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |


Scenario Outline: move a file from project to personal space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" moves a file "/textfile.txt" into "/" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "502"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces"
And for user "Alice" folder "/" of the space "project-space" should contain these files:
| textfile.txt |
But for user "Alice" the space "Personal" should not contain these entries:
| textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |


Scenario Outline: move a file from personal to project space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" moves a file "/textfile.txt" into "/" inside space "project-space" using file-id path "<dav-path>"
Then the HTTP status code should be "502"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces"
And for user "Alice" folder "/" of the space "Personal" should contain these files:
| textfile.txt |
But for user "Alice" the space "project-space" should not contain these entries:
| textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |


Scenario Outline: rename a file and move a file from project space to personal space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "project-space" using file-id path "<dav-path>"
And user "Alice" moves a file "/renamed.txt" into "/" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "502"
And for user "Alice" the space "project-space" should contain these entries:
| renamed.txt |
But for user "Alice" folder "/" of the space "Personal" should not contain these files:
| renamed.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |


Scenario Outline: rename a file and move a file from personal space to project space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "project-space" with the default quota using the GraphApi
And user "Alice" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "Personal" using file-id path "<dav-path>"
And user "Alice" moves a file "/renamed.txt" into "/" inside space "project-space" using file-id path "<dav-path>"
Then the HTTP status code should be "502"
And for user "Alice" the space "Personal" should contain these entries:
| renamed.txt |
But for user "Alice" folder "/" of the space "project-space" should not contain these files:
| renamed.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |

0 comments on commit 2b5bf97

Please sign in to comment.