Skip to content

Commit

Permalink
add test for default language (#7464)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor authored Oct 12, 2023
1 parent e316d8e commit 67cfcab
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ default:
- GraphContext:
- FilesVersionsContext:
- SettingsContext:
- OcisConfigContext:

apiAntivirus:
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
24 changes: 24 additions & 0 deletions tests/acceptance/features/apiNotification/notification.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<resource>" with user "Brian"
Expand Down

0 comments on commit 67cfcab

Please sign in to comment.