diff options
author | lain <lain@soykaf.club> | 2020-04-20 11:45:11 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-20 11:45:11 +0200 |
commit | ce23673ca1539350802326c62d6e72bd040950f6 (patch) | |
tree | 18581ae9230fe09cd009a74e085d1c440d4fc0df /test | |
parent | c8458209110ef65101f965e460329308e5843559 (diff) | |
download | pleroma-ce23673ca1539350802326c62d6e72bd040950f6.tar.gz |
ChatMessageValidator: Don't validate messages that are too long.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validator_test.exs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validator_test.exs b/test/web/activity_pub/object_validator_test.exs index bf0bfdfaf..e416e0808 100644 --- a/test/web/activity_pub/object_validator_test.exs +++ b/test/web/activity_pub/object_validator_test.exs @@ -11,6 +11,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do describe "chat messages" do setup do + clear_config([:instance, :remote_limit]) user = insert(:user) recipient = insert(:user, local: false) @@ -23,6 +24,13 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do assert {:ok, _object, _meta} = ObjectValidator.validate(valid_chat_message, []) end + test "does not validate if the message is longer than the remote_limit", %{ + valid_chat_message: valid_chat_message + } do + Pleroma.Config.put([:instance, :remote_limit], 2) + 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 |