Skip to content

Commit

Permalink
Merge pull request #38240 from owncloud/tests-update-share
Browse files Browse the repository at this point in the history
[tests-only] tests for file version and upload to share
  • Loading branch information
phil-davis authored Dec 24, 2020
2 parents bd88fc9 + bcb8a1d commit ecd072d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Feature: sharing

Scenario Outline: Uploading file to a group read-only share folder does not work
Given using <dav-path> DAV path
Given user "Brian" has been created with default attributes and skeleton files
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand Down Expand Up @@ -259,3 +259,22 @@ Feature: sharing
| 2 | welt |
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/myfile.txt" should not exist


Scenario Outline: Sharer can download file uploaded with different permission by sharee to a shared folder
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | <permissions> |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When user "Brian" uploads file with content "some content" to "/Shares/FOLDER/textFile.txt" using the WebDAV API
And user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "some content"
Examples:
| dav-path | permissions |
| old | change |
| new | create |
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,23 @@ Feature: sharing
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |


Scenario Outline: Sharer deletes file uploaded with upload-only permission by sharee to a shared folder
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | create |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And user "Brian" has uploaded file with content "some content" to "/Shares/FOLDER/textFile.txt"
When user "Alice" deletes file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Brian" file "/Shares/FOLDER/textFile.txt" should not exist
And as "Alice" file "/textFile.txt" should not exist
Examples:
| dav-path |
| old |
| new |
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiVersions/fileVersions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,4 @@ Feature: dav-versions
Scenario: User cannot access meta folder of a file with invalid fileid
Given user "Brian" has been created with default attributes and without skeleton files
When user "Brian" sends HTTP method "PROPFIND" to URL "/remote.php/dav/meta/MTI4NGQyMzgtYWEMi00MmNlLWJkxzQtMGIwMDAwMsA5MTU2OjhjY2QyNzUxLTkwYTQtNDBmMi1iOWYzLTYxZWRmODQ0MjFmNA==/v"
Then the HTTP status code should be "404"
Then the HTTP status code should be "404"
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,15 @@ Feature: dav-versions
And user "Alice" has shared file "textfile0.txt" with user "Brian"
When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
Then the HTTP status code should be "404"
And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"


Scenario: sharer tries get file versions of shared file when the sharee changes the content of the file
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
And user "Alice" has shared file "sharefile.txt" with user "Brian"
And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
When user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt"
Then the HTTP status code should be "204"
And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element

0 comments on commit ecd072d

Please sign in to comment.