defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
use Pleroma.DataCase
+ alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.CommonAPI
- alias Pleroma.Web.ActivityPub.Builder
import Pleroma.Factory
user = insert(:user)
recipient = insert(:user, local: false)
- {:ok, valid_chat_message, _} = Builder.chat_message(user, recipient.ap_id, "hey")
+ {:ok, valid_chat_message, _} = Builder.chat_message(user, recipient.ap_id, "hey :firefox:")
%{user: user, recipient: recipient, valid_chat_message: valid_chat_message}
end
test "validates for a basic object we build", %{valid_chat_message: valid_chat_message} do
- assert {:ok, _object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert object == valid_chat_message
end
test "does not validate if the message is longer than the remote_limit", %{