Add integration test for creating room shares when Talk is not enabled

The test just ensures that the controller will gracefully reject the
creation instead of failing miserably; the integration tests when Talk
is enabled are in the Talk repository.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2018-06-29 13:35:17 +02:00
parent 382b27d035
commit de403f2f3d
2 changed files with 36 additions and 0 deletions

View File

@ -679,6 +679,30 @@ trait Provisioning {
Assert::assertEquals(200, $this->response->getStatusCode()); Assert::assertEquals(200, $this->response->getStatusCode());
} }
/**
* @Given /^app "([^"]*)" is not enabled$/
*
* Checks that the app is disabled or not installed.
*
* @param string $app
*/
public function appIsNotEnabled($app) {
$fullUrl = $this->baseUrl . "v2.php/cloud/apps?filter=enabled";
$client = new Client();
$options = [];
if ($this->currentUser === 'admin') {
$options['auth'] = $this->adminUser;
}
$options['headers'] = [
'OCS-APIREQUEST' => 'true',
];
$this->response = $client->get($fullUrl, $options);
$respondedArray = $this->getArrayOfAppsResponded($this->response);
Assert::assertNotContains($app, $respondedArray);
Assert::assertEquals(200, $this->response->getStatusCode());
}
/** /**
* @Then /^user "([^"]*)" is disabled$/ * @Then /^user "([^"]*)" is disabled$/
* @param string $user * @param string $user

View File

@ -43,6 +43,18 @@ Feature: sharing
Then the OCS status code should be "100" Then the OCS status code should be "100"
And the HTTP status code should be "200" And the HTTP status code should be "200"
Scenario: Creating a new room share when Talk is not enabled
Given As an "admin"
And app "spreed" is not enabled
And user "user0" exists
And As an "user0"
When creating a share with
| path | welcome.txt |
| shareWith | a-room-token |
| shareType | 10 |
Then the OCS status code should be "403"
And the HTTP status code should be "401"
Scenario: Creating a new public share Scenario: Creating a new public share
Given user "user0" exists Given user "user0" exists
And As an "user0" And As an "user0"