Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-14 11:47:39 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-14 11:47:39 +0300
commit4c8ec2f769dff77f256a914335469dc0dc8ef730 (patch)
treed79588ec95156706647220a7fed4039e8cf67b3e /tests
parentfd6b42e12c16a4f25d74ad243b815234fc5f5986 (diff)
Add an integration test for when the last moderator leaves
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php14
-rw-r--r--tests/integration/features/conversation/remove-self.feature7
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 8a57ed813..8f64ba0e6 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -761,6 +761,20 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
/**
+ * @Then /^user "([^"]*)" gets room "([^"]*)" with (\d+)(?: \((v(1|2|3))\))?$/
+ *
+ * @param string $user
+ * @param string $identifier
+ * @param string $statusCode
+ * @param string $apiVersion
+ */
+ public function userGetsRoom($user, $identifier, $statusCode, $apiVersion = 'v1') {
+ $this->setCurrentUser($user);
+ $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier]);
+ $this->assertStatusCode($this->response, $statusCode);
+ }
+
+ /**
* @Then /^user "([^"]*)" renames room "([^"]*)" to "([^"]*)" with (\d+)(?: \((v(1|2|3))\))?$/
*
* @param string $user
diff --git a/tests/integration/features/conversation/remove-self.feature b/tests/integration/features/conversation/remove-self.feature
index 4a7ae5b5c..f1ef82f20 100644
--- a/tests/integration/features/conversation/remove-self.feature
+++ b/tests/integration/features/conversation/remove-self.feature
@@ -31,6 +31,13 @@ Feature: public
Then user "participant1" is participant of room "room"
And user "participant2" is not participant of room "room"
+ Scenario: Last moderator removes the room from their room list
+ Given user "participant1" creates room "room"
+ | roomType | 3 |
+ | roomName | room |
+ When user "participant1" removes themselves from room "room" with 200
+ Then user "participant2" gets room "room" with 404 (v3)
+
Scenario: User removes the room from their room list
Given user "participant1" creates room "room"
| roomType | 3 |