Skip to content

Commit fd89535

Browse files
refactor test to add federated user to a project space
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
1 parent 10bf7f1 commit fd89535

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md

-6
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
257257

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

260-
#### [OCM. Prevent federated users from being added as members of the space](https://github.com/owncloud/ocis/issues/10051)
261-
262-
- [apiOcm/share.feature:307](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L307)
263-
- [apiOcm/share.feature:308](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L308)
264-
- [apiOcm/share.feature:309](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L309)
265-
266260
#### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060)
267261

268262
- [apiSearch1/dateSearch.feature:17](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearch1/dateSearch.feature#L17)

tests/acceptance/features/apiOcm/share.feature

+36-21
Original file line numberDiff line numberDiff line change
@@ -272,43 +272,58 @@ Feature: an user shares resources using ScienceMesh application
272272
And "Alice" has created the federation share invitation
273273
And using server "REMOTE"
274274
And "Brian" has accepted invitation
275+
And using server "LOCAL"
275276
And using spaces DAV path
276-
And the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API
277-
And user "Brian" has created a space "brian's space" with the default quota using the Graph API
278-
When user "Brian" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:
279-
| space | brian's space |
280-
| sharee | Alice |
281-
| shareType | user |
282-
| permissionsRole | <permissions-role> |
283-
| federatedServer | @ocis-server:9200 |
284-
Then the HTTP status code should be "403"
277+
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
278+
And user "Alice" has created a space "alice's space" with the default quota using the Graph API
279+
When user "Alice" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:
280+
| space | alice's space |
281+
| sharee | Brian |
282+
| shareType | user |
283+
| permissionsRole | <permissions-role> |
284+
| federatedServer | @federation-ocis-server:10200 |
285+
Then the HTTP status code should be "400"
285286
And the JSON data of the response should match
286287
"""
287288
{
288289
"type": "object",
289-
"required": [
290-
"code",
291-
"message"
292-
],
290+
"required": ["error"],
293291
"properties": {
294-
"code": {
295-
"const": "PERMISSION_DENIED"
296-
},
297-
"message": {
298-
"const": "permission denied to create the file"
292+
"error": {
293+
"type": "object",
294+
"required": [
295+
"code",
296+
"innererror",
297+
"message"
298+
],
299+
"properties": {
300+
"code": {
301+
"const": "invalidRequest"
302+
},
303+
"innererror": {
304+
"type": "object",
305+
"required": [
306+
"date",
307+
"request-id"
308+
]
309+
},
310+
"message": {
311+
"const": "federated user can not become a space member"
312+
}
313+
}
299314
}
300315
}
301316
}
302317
"""
303-
And using server "LOCAL"
304-
And the user "Alice" should not have a space called "brian's space"
318+
And using server "REMOTE"
319+
And the user "Brian" should not have a space called "alice's space"
305320
Examples:
306321
| permissions-role |
307322
| Space Viewer |
308323
| Space Editor |
309324
| Manager |
310325

311-
326+
@issue-10051
312327
Scenario Outline: try to add federated user as a member of a project space (root endpoint)
313328
Given using server "LOCAL"
314329
And using spaces DAV path

0 commit comments

Comments
 (0)