Create space with description (#3168)

* send description during create space

* add changelog

* update reva

* add to API test

* only use opaque if not nil

* use forked xattr to fix windows build

Signed-off-by: Michael Barz <mbarz@owncloud.com>
This commit is contained in:
Michael Barz
2022-02-15 14:18:27 +01:00
committed by GitHub
parent c2c7478bf4
commit af0a5fac18
6 changed files with 60 additions and 24 deletions

View File

@@ -10,15 +10,17 @@ Feature: Change data of space
Given user "Alice" has been created with default attributes and without skeleton files
And the administrator has given "Alice" the role "Admin" using the settings api
Scenario: An admin user can change the name of a Space via the Graph API
Scenario: An admin user can change the name and description of a Space via the Graph API
Given user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
When user "Alice" changes the name of the "Project Jupiter" space to "Project Death Star"
And user "Alice" changes the description of the "Project Death Star" space to "The Death Star is a fictional mobile space station"
Then the HTTP status code should be "200"
When user "Alice" lists all available spaces via the GraphApi
Then the json responded should contain a space "Project Death Star" with these key and value pairs:
| key | value |
| driveType | project |
| name | Project Death Star |
| description | The Death Star is a fictional mobile space station |
| quota@@@total | 20 |
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |

View File

@@ -217,11 +217,11 @@ class SpacesContext implements Context {
$fullUrl = $this->baseUrl . "/api/v0/accounts/accounts-list";
$this->featureContext->setResponse(
HttpRequestHelper::post(
$fullUrl,
"",
$this->featureContext->getAdminUsername(),
$this->featureContext->getAdminPassword(),
[],
$fullUrl,
"",
$this->featureContext->getAdminUsername(),
$this->featureContext->getAdminPassword(),
[],
"{}"
)
);
@@ -756,7 +756,7 @@ class SpacesContext implements Context {
/**
* @Then /^the json responded should contain a space "([^"]*)" (?:|(?:owned by|granted to) "([^"]*)" )with these key and value pairs:$/
*
*
* @param string $spaceName
* @param string $userName
* @param TableNode $table
@@ -785,7 +785,7 @@ class SpacesContext implements Context {
[$this, "getSpaceIdByNameFromResponse"],
"parameter" => [$spaceName]
],
[
[
"code" => "%user_id%",
"function" =>
[$this, "getUserIdByUserName"],
@@ -1195,6 +1195,38 @@ class SpacesContext implements Context {
);
}
/**
* @When /^user "([^"]*)" changes the description of the "([^"]*)" space to "([^"]*)"$/
*
* @param string $user
* @param string $spaceName
* @param string $newName
*
* @return void
* @throws GuzzleException
* @throws Exception
*/
public function updateSpaceDescription(
string $user,
string $spaceName,
string $newDescription
): void {
$space = $this->getSpaceByName($user, $spaceName);
$spaceId = $space["id"];
$bodyData = ["description" => $newDescription];
$body = json_encode($bodyData, JSON_THROW_ON_ERROR);
$this->featureContext->setResponse(
$this->sendUpdateSpaceRequest(
$user,
$this->featureContext->getPasswordForUser($user),
$body,
$spaceId
)
);
}
/**
* @When /^user "([^"]*)" changes the quota of the "([^"]*)" space to "([^"]*)"$/
*
@@ -1351,9 +1383,9 @@ class SpacesContext implements Context {
}
$space = $this->getSpaceByName($user, $spaceName);
$body = [
"space_ref" => $space['id'],
"shareType" => 7,
"shareWith" => $userRecipient,
"space_ref" => $space['id'],
"shareType" => 7,
"shareWith" => $userRecipient,
"permissions" => $role
];