Skip to content

Commit

Permalink
make test work
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor committed Oct 7, 2024
1 parent afb1a63 commit 23bc315
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/acceptance/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function sendDriveShareInvitation(string $user, TableNode $table): Respon
$shareeId = "";
if ($shareType === "user") {
$shareeId = $this->featureContext->getAttributeOfCreatedUser($sharee, 'id');
if (isset($shareInfo['federatedServer'])) {
if (isset($rows['federatedServer'])) {
$shareeId = ($this->featureContext->ocmContext->getAcceptedUserByName($user, $sharee))['user_id'];
}
} elseif ($shareType === "group") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,11 @@ The expected failures in this file are from features in the owncloud/ocis repo.

- [apiOcm/deleteFederatedConnections.feature:103](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L103)

#### [OCM. Prevent federated users from being added as members of the space](https://github.com/owncloud/ocis/issues/10051)

- [apiOcm/share.feature:231](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L231)
- [apiOcm/share.feature:232](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L232)
- [apiOcm/share.feature:233](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L233)

Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.
36 changes: 25 additions & 11 deletions tests/acceptance/features/apiOcm/share.feature
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Feature: an user shares resources usin ScienceMesh application
| folderToShare |
| textfile.txt |


@issue-10051
Scenario Outline: users cannot add the federated users as members of the project space (permissions endpoint)
Given using server "LOCAL"
And "Alice" has created the federation share invitation
Expand Down Expand Up @@ -248,21 +248,35 @@ Feature: an user shares resources usin ScienceMesh application
| shareType | user |
| permissionsRole | <permissions-role> |
| federatedServer | @federation-ocis-server:10200 |
Then the HTTP status code should be "403"
Then the HTTP status code should be "400"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"required": ["error"],
"properties": {
"code": {
"const": "PERMISSION_DENIED"
},
"message": {
"const": "permission denied to create the file"
"error": {
"type": "object",
"required": [
"code",
"innererror",
"message"
],
"properties": {
"code": {
"const": "invalidRequest"
},
"innererror": {
"type": "object",
"required": [
"date",
"request-id"
]
},
"message": {
"const": "federated user can not become a space member"
}
}
}
}
}
Expand Down

0 comments on commit 23bc315

Please sign in to comment.