diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index e81cf71fa3..b72a155be3 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -167,3 +167,24 @@ Feature: Share spaces | editor | viewer | | viewer | manager | | viewer | editor | + + + Scenario Outline: A user shares a space with a group + Given group "group2" has been created + And the administrator has added a user "Brian" to the group "group2" using GraphApi + And the administrator has added a user "Bob" to the group "group2" using GraphApi + When user "Alice" shares a space "share space" to group "group2" with role "" + Then the HTTP status code should be "200" + And the user "Brian" should have a space called "share space" with these key and value pairs: + | key | value | + | driveType | project | + | name | share space | + And the user "Bob" should have a space called "share space" with these key and value pairs: + | key | value | + | driveType | project | + | name | share space | + Examples: + | role | + | manager | + | editor | + | viewer | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index cd2aa47ec1..8af866f917 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1353,7 +1353,7 @@ class SpacesContext implements Context { "Expected response status code should be 200" ); } - + /** * @When /^user "([^"]*)" sets the file "([^"]*)" as a (description|space image)\s? in a special section of the "([^"]*)" space$/ * @@ -1775,11 +1775,12 @@ class SpacesContext implements Context { /** * @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/ + * @When /^user "([^"]*)" shares a space "([^"]*)" to group "([^"]*)" with role "([^"]*)"$/ * @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/ * * @param string $user * @param string $spaceName - * @param string $userRecipient + * @param string $recipient * @param string $role * * @return void @@ -1788,7 +1789,7 @@ class SpacesContext implements Context { public function sendShareSpaceRequest( string $user, string $spaceName, - string $userRecipient, + string $recipient, string $role ): void { $space = $this->getSpaceByName($user, $spaceName); @@ -1799,7 +1800,7 @@ class SpacesContext implements Context { $body = [ "space_ref" => $space['id'], "shareType" => 7, - "shareWith" => $userRecipient, + "shareWith" => $recipient, "role" => $role // role overrides the permissions parameter ];