From 67cfcabe5d294c2bd79dcafca42647e60be67f7b Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 12 Oct 2023 10:40:12 +0200 Subject: [PATCH] add test for default language (#7464) --- tests/acceptance/config/behat.yml | 1 + .../apiNotification/emailNotification.feature | 28 +++++++++++++++++++ .../apiNotification/notification.feature | 24 ++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 16a61f243..1190559c5 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -168,6 +168,7 @@ default: - GraphContext: - FilesVersionsContext: - SettingsContext: + - OcisConfigContext: apiAntivirus: paths: diff --git a/tests/acceptance/features/apiNotification/emailNotification.feature b/tests/acceptance/features/apiNotification/emailNotification.feature index 139f4530a..09b610a86 100644 --- a/tests/acceptance/features/apiNotification/emailNotification.feature +++ b/tests/acceptance/features/apiNotification/emailNotification.feature @@ -180,3 +180,31 @@ Feature: Email notification Click here to check it: %base_url%/f/%space_id% """ + + @env-config + Scenario: group members get an email notification in default language when someone shares a file with the group + Given the config "SETTINGS_DEFAULT_LANGUAGE" has been set to "de" + And user "Carol" has been created with default attributes and without skeleton files + And group "group1" has been created + And user "Brian" has been added to group "group1" + And user "Carol" has been added to group "group1" + And user "Alice" has uploaded file with content "hello world" to "text.txt" + When user "Alice" shares file "text.txt" with group "group1" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "100" + And user "Brian" should have received the following email from user "Alice" + """ + Hallo Brian Murphy + + %displayname% hat "text.txt" mit Ihnen geteilt. + + Zum Ansehen hier klicken: %base_url%/files/shares/with-me + """ + And user "Carol" should have received the following email from user "Alice" + """ + Hallo Carol King + + %displayname% hat "text.txt" mit Ihnen geteilt. + + Zum Ansehen hier klicken: %base_url%/files/shares/with-me + """ diff --git a/tests/acceptance/features/apiNotification/notification.feature b/tests/acceptance/features/apiNotification/notification.feature index 606d74b1d..841b7782c 100644 --- a/tests/acceptance/features/apiNotification/notification.feature +++ b/tests/acceptance/features/apiNotification/notification.feature @@ -268,6 +268,30 @@ Feature: Notification | de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | | es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | + @env-config + Scenario: get a notification about a file share in default languages + Given the config "SETTINGS_DEFAULT_LANGUAGE" has been set to "de" + And user "Alice" has shared entry "textfile1.txt" with user "Brian" with permissions "17" + When user "Brian" lists all notifications + Then the HTTP status code should be "200" + And the JSON response should contain a notification message with the subject "Neue Freigabe" and the message-details should match + """ + { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "enum": [ + "Alice Hansen hat textfile1.txt mit Ihnen geteilt" + ] + } + } + } + """ + Scenario Outline: notifications related to a resource get deleted when the resource is deleted Given user "Alice" has shared entry "" with user "Brian"