aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-06-29 13:35:17 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-08-08 14:25:43 +0200
commitde403f2f3da09015a07400d90703642a5eabcc65 (patch)
tree1b18e19e27ddf19c3e8c9cfca99747a0e39501be /build
parent382b27d03524d18885330847cc8dc261b041c027 (diff)
downloadnextcloud-server-de403f2f3da09015a07400d90703642a5eabcc65.tar.gz
nextcloud-server-de403f2f3da09015a07400d90703642a5eabcc65.zip
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>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/Provisioning.php24
-rw-r--r--build/integration/features/sharing-v1.feature12
2 files changed, 36 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index 1a2c32ed8c6..c320be2be6c 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -680,6 +680,30 @@ trait Provisioning {
}
/**
+ * @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$/
* @param string $user
*/
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature
index 5708b7115e4..dd5cc9fff4f 100644
--- a/build/integration/features/sharing-v1.feature
+++ b/build/integration/features/sharing-v1.feature
@@ -43,6 +43,18 @@ Feature: sharing
Then the OCS status code should be "100"
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
Given user "user0" exists
And As an "user0"