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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-07 03:39:36 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-12-07 06:48:00 +0300
commitb4b3276a5be575d6edefca1214c38c2bd0f0b4e5 (patch)
tree201e61ecd08b45156fbb88d5f670e5a401d6bc1b /build
parent1552add4caaa5239e67d416dd75c4d7ca9085419 (diff)
Add integration tests for getting guest avatars
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/avatar.feature16
-rw-r--r--build/integration/features/bootstrap/Avatar.php14
2 files changed, 30 insertions, 0 deletions
diff --git a/build/integration/features/avatar.feature b/build/integration/features/avatar.feature
index 579417844ef..f7926615c01 100644
--- a/build/integration/features/avatar.feature
+++ b/build/integration/features/avatar.feature
@@ -165,3 +165,19 @@ Feature: avatar
| X-NC-IsCustomAvatar | 1 |
And last avatar is a square of size 96
And last avatar is a single "#FF0000" color
+
+
+
+ Scenario: get default guest avatar
+ When user "user0" gets avatar for guest "guest0"
+ Then The following headers should be set
+ | Content-Type | image/png |
+ And last avatar is a square of size 128
+ And last avatar is not a single color
+
+ Scenario: get default guest avatar as an anonymous user
+ When user "anonymous" gets avatar for guest "guest0"
+ Then The following headers should be set
+ | Content-Type | image/png |
+ And last avatar is a square of size 128
+ And last avatar is not a single color
diff --git a/build/integration/features/bootstrap/Avatar.php b/build/integration/features/bootstrap/Avatar.php
index 90cc36067bf..388715340c6 100644
--- a/build/integration/features/bootstrap/Avatar.php
+++ b/build/integration/features/bootstrap/Avatar.php
@@ -72,6 +72,20 @@ trait Avatar {
}
/**
+ * @When user :user gets avatar for guest :guestAvatar
+ *
+ * @param string $user
+ * @param string $guestAvatar
+ */
+ public function userGetsAvatarForGuest(string $user, string $guestAvatar) {
+ $this->asAn($user);
+ $this->sendingToDirectUrl('GET', '/index.php/avatar/guest/' . $guestAvatar . '/128');
+ $this->theHTTPStatusCodeShouldBe('201');
+
+ $this->getLastAvatar();
+ }
+
+ /**
* @When logged in user gets temporary avatar
*/
public function loggedInUserGetsTemporaryAvatar() {