diff options
author | lain <lain@soykaf.club> | 2020-07-06 15:57:19 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-06 15:57:19 +0200 |
commit | a6a12b241fbacd3ff35cd901190e62d14aaac3c2 (patch) | |
tree | 574f2a2df5385645487a32cd22f1fb6dd410b8f3 /test | |
parent | 4e3b3998ad849943fbae3590ce7e892d2dfc54d3 (diff) | |
download | pleroma-a6a12b241fbacd3ff35cd901190e62d14aaac3c2.tar.gz pleroma-a6a12b241fbacd3ff35cd901190e62d14aaac3c2.zip |
FollowValidator: Add basic validation.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validators/follow_validation_test.exs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validators/follow_validation_test.exs b/test/web/activity_pub/object_validators/follow_validation_test.exs new file mode 100644 index 000000000..6e1378be2 --- /dev/null +++ b/test/web/activity_pub/object_validators/follow_validation_test.exs @@ -0,0 +1,26 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do + use Pleroma.DataCase + + 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 |