Skip to content

Commit a2752ac

Browse files
committed
adding test for editing shared file(OCM) by the share receiver
1 parent 2deeda7 commit a2752ac

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

tests/acceptance/bootstrap/SpacesContext.php

+23
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,29 @@ public function theUserUploadsAFileToSpace(
13451345
$this->featureContext->setResponse($response);
13461346
}
13471347

1348+
/**
1349+
* @When /^user "([^"]*)" uploads a file inside federated space "([^"]*)" with content "([^"]*)" to "([^"]*)" using the WebDAV API$/
1350+
*
1351+
* @param string $user
1352+
* @param string $spaceName
1353+
* @param string $content
1354+
* @param string $destination
1355+
*
1356+
* @return void
1357+
* @throws GuzzleException
1358+
* @throws Exception
1359+
*/
1360+
public function theUserUploadsAFileToFedratedSpace(
1361+
string $user,
1362+
string $spaceName,
1363+
string $content,
1364+
string $destination
1365+
): void {
1366+
$spaceId = $this->featureContext->spacesContext->getSharesRemoteItemId($user, $destination);
1367+
$response = $this->featureContext->uploadFileWithContent($user, $content, $destination, $spaceId);
1368+
$this->featureContext->setResponse($response);
1369+
}
1370+
13481371
/**
13491372
* @When /^user "([^"]*)" uploads a file "([^"]*)" to "([^"]*)" in space "([^"]*)" using the WebDAV API$/
13501373
*

tests/acceptance/features/apiOcm/share.feature

+23
Original file line numberDiff line numberDiff line change
@@ -733,3 +733,26 @@ Feature: an user shares resources using ScienceMesh application
733733
When using server "LOCAL"
734734
And user "Alice" uploads a file with content "lorem" to "file.txt" inside federated share "FOLDER" via TUS using the WebDAV API
735735
Then for user "Alice" the content of file "file.txt" of federated share "FOLDER" should be "lorem"
736+
737+
@issue-9898
738+
Scenario: user lists permissions of a resource shared to a federated user
739+
Given using spaces DAV path
740+
And using server "LOCAL"
741+
And "Alice" has created the federation share invitation
742+
And using server "REMOTE"
743+
And "Brian" has accepted invitation
744+
And using server "LOCAL"
745+
And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt"
746+
And user "Alice" has sent the following resource share invitation to federated user:
747+
| resource | textfile.txt |
748+
| space | Personal |
749+
| sharee | Brian |
750+
| shareType | user |
751+
| permissionsRole | File Editor |
752+
And using server "REMOTE"
753+
And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "ocm test"
754+
When user "Brian" uploads a file inside federated space "Shares" with content "this is a new content" to "textfile.txt" using the WebDAV API
755+
Then the HTTP status code should be "204"
756+
And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "this is a new content"
757+
And using server "LOCAL"
758+
And for user "Alice" the content of the file "textfile.txt" of the space "Personal" should be "this is a new content"

0 commit comments

Comments
 (0)