Skip to content

Commit

Permalink
API tests for capabilities endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Aug 25, 2023
1 parent cdfdd5f commit 84621bf
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/acceptance/features/api/capabilities.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Feature: get capabilities of the app

Scenario: Get capabilities when group folder app is enabled
When the administrator requests the nextcloud capabilities
Then the HTTP status code should be "200"
And the ocs data of the response should match
""""
{
"type": "object",
"required": [
"capabilities"
],
"properties": {
"capabilities": {
"type": "object",
"required": [
"integration_openproject"
],
"properties": {
"integration_openproject": {
"type": "object",
"required": [
"app_version",
"groupfolder_version",
"groupfolders_enabled"
],
"properties": {
"app_version": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"groupfolder_version": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"groupfolders_enabled": {
"type": "boolean",
"enum": [
true
]
}
}
}
}
}
}
}
"""
10 changes: 10 additions & 0 deletions tests/acceptance/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,16 @@ public function theUserSendsARequestToTheEndpoint(
);
}

/**
* @When the administrator requests the nextcloud capabilities
*
* @return void
*/
public function theAdministratorRequestsCapabilities(): void {
$this->response = $this->sendOCSRequest(
'/cloud/capabilities', 'GET', $this->getAdminUsername()
);
}

/**
* @Then /^the content of file at "([^"]*)" for user "([^"]*)" should be "([^"]*)"$/
Expand Down

0 comments on commit 84621bf

Please sign in to comment.