-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for sending share invitation to user with role
- Loading branch information
Showing
4 changed files
with
234 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
tests/acceptance/features/apiSharingNg/shareInvitations.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
Feature: Send a sharing invitations | ||
As the owner of a resource | ||
I want to be able to send invitations to other users | ||
So that they can have access to it | ||
|
||
https://owncloud.dev/libre-graph-api/#/drives.permissions/Invite | ||
|
||
Background: | ||
Given these users have been created with default attributes and without skeleton files: | ||
| username | | ||
| Alice | | ||
| Brian | | ||
|
||
|
||
Scenario Outline: send sharing invitation to user with different roles via the Graph API | ||
Given user "Alice" has uploaded file with content "to share" to "/textfile1.txt" | ||
And user "Alice" has created folder "FolderToShare" | ||
When user "Alice" sends the following share invitation using the Graph API: | ||
| resourceType | <resource-type> | | ||
| resource | <path> | | ||
| space | Personal | | ||
| sharee | Brian | | ||
| shareType | user | | ||
| role | <role> | | ||
Then the HTTP status code should be "200" | ||
And the JSON data of the response should match | ||
""" | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"value" | ||
], | ||
"properties": { | ||
"value": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"roles", | ||
"grantedToV2" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"pattern": "^%share_id_pattern%$" | ||
}, | ||
"roles": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^%role_id_pattern%$" | ||
} | ||
}, | ||
"grantedToV2": { | ||
"type": "object", | ||
"required": [ | ||
"user" | ||
], | ||
"properties": { | ||
"user": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"displayName" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"pattern": "^%user_id_pattern%$" | ||
}, | ||
"displayName": { | ||
"type": "string", | ||
"enum": [ | ||
"Brian Murphy" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
Examples: | ||
| role | resource-type | path | | ||
| Viewer | file | /textfile1.txt | | ||
| File Editor | file | /textfile1.txt | | ||
| Co Owner | file | /textfile1.txt | | ||
| Manager | file | /textfile1.txt | | ||
| Viewer | folder | FolderToShare | | ||
| Editor | folder | FolderToShare | | ||
| Co Owner | folder | FolderToShare | | ||
| Uploader | folder | FolderToShare | | ||
| Manager | folder | FolderToShare | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters