logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

follow_validation_test.exs (797B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do
  5. use Pleroma.DataCase
  6. alias Pleroma.Web.ActivityPub.Builder
  7. alias Pleroma.Web.ActivityPub.ObjectValidator
  8. import Pleroma.Factory
  9. describe "Follows" do
  10. setup do
  11. follower = insert(:user)
  12. followed = insert(:user)
  13. {:ok, valid_follow, []} = Builder.follow(follower, followed)
  14. %{follower: follower, followed: followed, valid_follow: valid_follow}
  15. end
  16. test "validates a basic follow object", %{valid_follow: valid_follow} do
  17. assert {:ok, _follow, []} = ObjectValidator.validate(valid_follow, [])
  18. end
  19. end
  20. end