2020-07-06 13:57:19 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-13 06:49:20 +00:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2020-07-06 13:57:19 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do
|
2020-12-21 11:21:40 +00:00
|
|
|
use Pleroma.DataCase, async: true
|
2020-07-06 13:57:19 +00:00
|
|
|
|
|
|
|
alias Pleroma.Web.ActivityPub.Builder
|
|
|
|
alias Pleroma.Web.ActivityPub.ObjectValidator
|
|
|
|
|
|
|
|
import Pleroma.Factory
|
|
|
|
|
|
|
|
describe "Follows" do
|
|
|
|
setup do
|
|
|
|
follower = insert(:user)
|
|
|
|
followed = insert(:user)
|
|
|
|
|
|
|
|
{:ok, valid_follow, []} = Builder.follow(follower, followed)
|
|
|
|
%{follower: follower, followed: followed, valid_follow: valid_follow}
|
|
|
|
end
|
|
|
|
|
|
|
|
test "validates a basic follow object", %{valid_follow: valid_follow} do
|
|
|
|
assert {:ok, _follow, []} = ObjectValidator.validate(valid_follow, [])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|