Add integration tests for sharing permissions

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-30 17:38:17 +01:00
parent 609a7b275f
commit 6f040d030f
5 changed files with 83 additions and 145 deletions

View File

@@ -25,7 +25,7 @@ Feature: acl
Scenario: Fetch board details of an other users board
Given Logging in using web as "admin"
And creates a board named "MyPrivateAdminBoard" with color "fafafa"
And creates a board named "MyPrivateAdminBoard" with color "ff0000"
Given Logging in using web as "user0"
When fetches the board named "MyPrivateAdminBoard"
Then the response should have a status code "403"
@@ -33,13 +33,60 @@ Feature: acl
Scenario: Share a board
Given Logging in using web as "user0"
And creates a board named "Shared board" with color "fafafa"
And creates a board named "Shared board" with color "ff0000"
And shares the board with user "user1"
Then the HTTP status code should be "200"
| permissionEdit | 0 |
| permissionShare | 0 |
| permissionManage | 0 |
And the response should have a status code 200
And shares the board with user "user2"
| permissionEdit | 1 |
| permissionShare | 1 |
| permissionManage | 1 |
And the response should have a status code 200
Given Logging in using web as "user2"
When fetches the board named "Shared board"
Then the current user should have "read" permissions on the board
And the current user should have "edit" permissions on the board
And the current user should have "share" permissions on the board
And the current user should have "manage" permissions on the board
And create a stack named "Stack"
And the response should have a status code 200
And create a card named "Test"
And the response should have a status code 200
Given Logging in using web as "user1"
When fetches the board named "Shared board"
And the current user should have read permissions on the board
And the current user should have write permissions on the board
And the current user should have share permissions on the board
And the current user should have manage permissions on the board
Then the HTTP status code should be "200"
And create a card named "Test"
And the response should have a status code 403
Then the current user should have "read" permissions on the board
And the current user should not have "edit" permissions on the board
And the current user should not have "share" permissions on the board
And the current user should not have "manage" permissions on the board
And create a stack named "Stack"
And the response should have a status code 403
Scenario: Reshare a board
Given Logging in using web as "user0"
And creates a board named "Reshared board" with color "ff0000"
And shares the board with user "user1"
| permissionEdit | 0 |
| permissionShare | 1 |
| permissionManage | 0 |
And the response should have a status code 200
Given Logging in using web as "user1"
When fetches the board named "Shared board"
And shares the board with user "user2"
| permissionEdit | 1 |
| permissionShare | 1 |
| permissionManage | 1 |
And the response should have a status code 200
Given Logging in using web as "user2"
When fetches the board named "Shared board"
Then the current user should have "read" permissions on the board
And the current user should not have "edit" permissions on the board
And the current user should have "share" permissions on the board
And the current user should not have "manage" permissions on the board