2019-11-05 14:02:31 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-13 06:49:20 +00:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2019-11-05 14:02:31 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-10-21 08:23:10 +00:00
|
|
|
defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest do
|
2020-12-21 11:21:40 +00:00
|
|
|
use Pleroma.DataCase, async: true
|
2019-11-05 14:02:31 +00:00
|
|
|
|
2020-10-21 08:23:10 +00:00
|
|
|
alias Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidator
|
2019-11-05 14:02:31 +00:00
|
|
|
alias Pleroma.Web.ActivityPub.Utils
|
|
|
|
|
|
|
|
import Pleroma.Factory
|
|
|
|
|
|
|
|
describe "Notes" do
|
|
|
|
setup do
|
|
|
|
user = insert(:user)
|
|
|
|
|
|
|
|
note = %{
|
|
|
|
"id" => Utils.generate_activity_id(),
|
|
|
|
"type" => "Note",
|
|
|
|
"actor" => user.ap_id,
|
|
|
|
"to" => [user.follower_address],
|
|
|
|
"cc" => [],
|
|
|
|
"content" => "Hellow this is content.",
|
|
|
|
"context" => "xxx",
|
|
|
|
"summary" => "a post"
|
|
|
|
}
|
|
|
|
|
|
|
|
%{user: user, note: note}
|
|
|
|
end
|
|
|
|
|
|
|
|
test "a basic note validates", %{note: note} do
|
2020-10-21 08:23:10 +00:00
|
|
|
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
|
2019-11-05 14:02:31 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|