summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-05-26 17:58:44 +0200
committerJoas Schilling <coding@schilljs.com>2023-06-01 06:34:48 +0200
commit67c22f97d7d9a10fe085f7bc65ee4f0c23c9e652 (patch)
tree483c2e4470e4af917e1f19bc8cad5e0ba2448e3b /tests/integration
parentf3ae7767765cad30ec28b8e8d45e2c1d65483f22 (diff)
feat(API): Allow to block older clients
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php14
-rw-r--r--tests/integration/features/integration/outdated-client.feature24
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 97c842e9f..25adfa5ba 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -3452,6 +3452,20 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
/**
+ * @Then /^client "([^"]*)" requests room list with (\d+) \((v4)\)$/
+ *
+ * @param string $userAgent
+ * @param int $statusCode
+ * @param string $apiVersion
+ */
+ public function getRoomListWithSpecificUserAgent(string $userAgent, int $statusCode, string $apiVersion): void {
+ $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/room', null, [
+ 'USER_AGENT' => $userAgent,
+ ]);
+ $this->assertStatusCode($this->response, $statusCode);
+ }
+
+ /**
* @Then the response error matches with :error
*/
public function assertResponseErrorMatchesWith(string $error): void {
diff --git a/tests/integration/features/integration/outdated-client.feature b/tests/integration/features/integration/outdated-client.feature
new file mode 100644
index 000000000..7611b67de
--- /dev/null
+++ b/tests/integration/features/integration/outdated-client.feature
@@ -0,0 +1,24 @@
+Feature: integration/outdated-client
+ Background:
+ Given user "participant1" exists
+
+ Scenario: Check if outdated clients correctly receive a 426 error
+ Given as user "participant1"
+ # Android
+ When client "Mozilla/5.0 (Android) Nextcloud-Talk v14.1.1" requests room list with 426 (v4)
+ Then last response body contains "15.0.0"
+ When client "Mozilla/5.0 (Android) Nextcloud-Talk v17.0.0" requests room list with 200 (v4)
+ # iOS
+ When client "Mozilla/5.0 (iOS) Nextcloud-Talk v14.1.1" requests room list with 426 (v4)
+ Then last response body contains "15.0.0"
+ When client "Mozilla/5.0 (iOS) Nextcloud-Talk v17.0.0" requests room list with 200 (v4)
+ # Desktop
+ When client "Mozilla/5.0 (Linux) Nextcloud-Talk v0.3.2" requests room list with 426 (v4)
+ Then last response body contains "0.6.0"
+ When client "Mozilla/5.0 (Linux) Nextcloud-Talk v0.6.0" requests room list with 200 (v4)
+ When client "Mozilla/5.0 (Mac) Nextcloud-Talk v0.3.2" requests room list with 426 (v4)
+ Then last response body contains "0.6.0"
+ When client "Mozilla/5.0 (Mac) Nextcloud-Talk v0.6.0" requests room list with 200 (v4)
+ When client "Mozilla/5.0 (Windows) Nextcloud-Talk v0.3.2" requests room list with 426 (v4)
+ Then last response body contains "0.6.0"
+ When client "Mozilla/5.0 (Windows) Nextcloud-Talk v0.6.0" requests room list with 200 (v4)