e408c85c3e48f6ee76c88e1e4839fd3b8b31333c
[akkoma] / test / pleroma / web / activity_pub / object_validators / article_note_validator_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidatorTest do
6 use Pleroma.DataCase, async: true
7
8 alias Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidator
9 alias Pleroma.Web.ActivityPub.Utils
10
11 import Pleroma.Factory
12
13 describe "Notes" do
14 setup do
15 user = insert(:user)
16
17 note = %{
18 "id" => Utils.generate_activity_id(),
19 "type" => "Note",
20 "actor" => user.ap_id,
21 "to" => [user.follower_address],
22 "cc" => [],
23 "content" => "Hellow this is content.",
24 "context" => "xxx",
25 "summary" => "a post"
26 }
27
28 %{user: user, note: note}
29 end
30
31 test "a basic note validates", %{note: note} do
32 %{valid?: true} = ArticleNoteValidator.cast_and_validate(note)
33 end
34 end
35 end