Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-10-25 18:02:05 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-26 15:22:17 +0300
commitd0b205d0dd59152455a4942d1882c2198623956c (patch)
tree0f8764b6d585ccfea4acf7c4004f95ca3e0b16a6 /build
parentcc4362df4f09aa7f6ad75b5c30e8881122b543b1 (diff)
Add more integration tests for getting shares
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/integration/sharing_features/sharing-v1-part2.feature124
-rw-r--r--build/integration/sharing_features/sharing-v1.feature4
2 files changed, 126 insertions, 2 deletions
diff --git a/build/integration/sharing_features/sharing-v1-part2.feature b/build/integration/sharing_features/sharing-v1-part2.feature
index 49a1afe106d..c3f2c8e915e 100644
--- a/build/integration/sharing_features/sharing-v1-part2.feature
+++ b/build/integration/sharing_features/sharing-v1-part2.feature
@@ -20,6 +20,69 @@ Feature: sharing
And User "user2" should be included in the response
And User "user3" should not be included in the response
+ Scenario: getting all shares of a file with a received share after revoking the resharing rights
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And file "textfile0.txt" of user "user1" is shared with user "user0"
+ And Updating last share with
+ | permissions | 1 |
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ When As an "user0"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | share_type | 0 |
+ | uid_owner | user1 |
+ | displayname_owner | user1 |
+ | path | /textfile0 (2).txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | shared::/textfile0 (2).txt |
+ | file_target | /textfile0.txt |
+ | share_with | user2 |
+ | share_with_displayname | user2 |
+
+ Scenario: getting all shares of a file with a received share also reshared after revoking the resharing rights
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And user "user3" exists
+ And file "textfile0.txt" of user "user1" is shared with user "user0"
+ And save the last share data as "textfile0.txt from user1"
+ And file "textfile0 (2).txt" of user "user0" is shared with user "user3"
+ And restore the last share data from "textfile0.txt from user1"
+ And Updating last share with
+ | permissions | 1 |
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ When As an "user0"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
+ Then the list of returned shares has 2 shares
+ And share 0 is returned with
+ | share_type | 0 |
+ | uid_owner | user0 |
+ | displayname_owner | user0 |
+ | uid_file_owner | user1 |
+ | displayname_file_owner | user1 |
+ | path | /textfile0 (2).txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | shared::/textfile0 (2).txt |
+ | file_target | /textfile0 (2).txt |
+ | share_with | user3 |
+ | share_with_displayname | user3 |
+ And share 1 is returned with
+ | share_type | 0 |
+ | uid_owner | user1 |
+ | displayname_owner | user1 |
+ | path | /textfile0 (2).txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | shared::/textfile0 (2).txt |
+ | file_target | /textfile0.txt |
+ | share_with | user2 |
+ | share_with_displayname | user2 |
+
Scenario: Reshared files can be still accessed if a user in the middle removes it.
Given user "user0" exists
And user "user1" exists
@@ -301,6 +364,67 @@ Feature: sharing
| share_with_displayname | user2 |
| permissions | 31 |
+ Scenario: getting all shares including subfiles in a directory after moving a received share not reshareable also shared with another user
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And file "textfile0.txt" of user "user1" is shared with user "user0"
+ And Updating last share with
+ | permissions | 1 |
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ And User "user0" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt"
+ When As an "user0"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=/FOLDER"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | share_type | 0 |
+ | uid_owner | user1 |
+ | displayname_owner | user1 |
+ | path | /FOLDER/textfile0.txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | shared::/FOLDER/textfile0.txt |
+ | file_target | /textfile0.txt |
+ | share_with | user2 |
+ | share_with_displayname | user2 |
+
+ Scenario: getting all shares including subfiles in a directory after moving a share and a received share not reshareable also shared with another user
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And file "textfile0.txt" of user "user0" is shared with user "user1"
+ And file "textfile0.txt" of user "user1" is shared with user "user0"
+ And Updating last share with
+ | permissions | 1 |
+ And file "textfile0.txt" of user "user1" is shared with user "user2"
+ And User "user0" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
+ And User "user0" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0 (2).txt"
+ When As an "user0"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=/FOLDER"
+ Then the list of returned shares has 2 shares
+ And share 0 is returned with
+ | share_type | 0 |
+ | uid_owner | user0 |
+ | displayname_owner | user0 |
+ | path | /FOLDER/textfile0.txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | home::user0 |
+ | file_target | /textfile0 (2).txt |
+ | share_with | user1 |
+ | share_with_displayname | user1 |
+ And share 1 is returned with
+ | share_type | 0 |
+ | uid_owner | user1 |
+ | displayname_owner | user1 |
+ | path | /FOLDER/textfile0 (2).txt |
+ | item_type | file |
+ | mimetype | text/plain |
+ | storage_id | shared::/FOLDER/textfile0 (2).txt |
+ | file_target | /textfile0.txt |
+ | share_with | user2 |
+ | share_with_displayname | user2 |
+
Scenario: keep group permissions in sync
Given As an "admin"
Given user "user0" exists
diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature
index 81c96b8be5c..b655a835bd7 100644
--- a/build/integration/sharing_features/sharing-v1.feature
+++ b/build/integration/sharing_features/sharing-v1.feature
@@ -305,7 +305,7 @@ Feature: sharing
And User "user2" should be included in the response
And User "user3" should not be included in the response
- Scenario: getting all shares of a file with a user with resharing rights
+ Scenario: getting all shares of a file with a user with resharing rights but not yourself
Given user "user0" exists
And user "user1" exists
And user "user2" exists
@@ -316,7 +316,7 @@ Feature: sharing
When sending "GET" to "/apps/files_sharing/api/v1/shares?path=textfile0 (2).txt&reshares=true"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
- And User "user1" should be included in the response
+ And User "user1" should not be included in the response
And User "user2" should be included in the response
And User "user3" should not be included in the response