logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

article_note_validator_test.exs (948B)


  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. defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidatorTest do
  5. use Pleroma.DataCase, async: true
  6. alias Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidator
  7. alias Pleroma.Web.ActivityPub.Utils
  8. import Pleroma.Factory
  9. describe "Notes" do
  10. setup do
  11. user = insert(:user)
  12. note = %{
  13. "id" => Utils.generate_activity_id(),
  14. "type" => "Note",
  15. "actor" => user.ap_id,
  16. "to" => [user.follower_address],
  17. "cc" => [],
  18. "content" => "Hellow this is content.",
  19. "context" => "xxx",
  20. "summary" => "a post"
  21. }
  22. %{user: user, note: note}
  23. end
  24. test "a basic note validates", %{note: note} do
  25. %{valid?: true} = ArticleNoteValidator.cast_and_validate(note)
  26. end
  27. end
  28. end