ChatMessageValidator: Additional validation.
This commit is contained in:
parent
3ca9af1f9f
commit
4a7b89e372
2 changed files with 17 additions and 0 deletions
|
|
@ -223,6 +223,17 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
|
|||
refute match?({:ok, _object, _meta}, ObjectValidator.validate(valid_chat_message, []))
|
||||
end
|
||||
|
||||
test "does not validate if the recipient is not accepting chat messages", %{
|
||||
valid_chat_message: valid_chat_message,
|
||||
recipient: recipient
|
||||
} do
|
||||
recipient
|
||||
|> Ecto.Changeset.change(%{accepts_chat_messages: false})
|
||||
|> Pleroma.Repo.update!()
|
||||
|
||||
refute match?({:ok, _object, _meta}, ObjectValidator.validate(valid_chat_message, []))
|
||||
end
|
||||
|
||||
test "does not validate if the actor or the recipient is not in our system", %{
|
||||
valid_chat_message: valid_chat_message
|
||||
} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue