Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33101604
welcome_chat_message_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
welcome_chat_message_test.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.User.WelcomeChatMessageTest
do
use
Pleroma.DataCase
alias
Pleroma.User.WelcomeChatMessage
import
Pleroma.Factory
setup
do
:
clear_config
([
:welcome
])
describe
"post_message/1"
do
test
"send a chat welcome message"
do
welcome_user
=
insert
(
:user
,
name
:
"mewmew"
)
user
=
insert
(
:user
)
clear_config
([
:welcome
,
:chat_message
,
:enabled
],
true
)
clear_config
([
:welcome
,
:chat_message
,
:sender_nickname
],
welcome_user
.
nickname
)
clear_config
(
[
:welcome
,
:chat_message
,
:message
],
"Hello, welcome to Blob/Cat!"
)
{
:ok
,
%
Pleroma.Activity
{}
=
activity
}
=
WelcomeChatMessage
.
post_message
(
user
)
assert
user
.
ap_id
in
activity
.
recipients
assert
Pleroma.Object
.
normalize
(
activity
,
fetch
:
false
)
.
data
[
"type"
]
==
"ChatMessage"
assert
Pleroma.Object
.
normalize
(
activity
,
fetch
:
false
)
.
data
[
"content"
]
==
"Hello, welcome to Blob/Cat!"
end
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 12:38 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
943655
Default Alt Text
welcome_chat_message_test.exs (1 KB)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment