summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/object_validators/accept_validation_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-11-12 12:34:48 +0000
committerrinpatch <rinpatch@sdf.org>2020-11-12 12:34:48 +0000
commit1172844ed18d94d84724dc6f11c6e9f72e0ba6ec (patch)
tree7d48a259e08856ab6db0eba255f20c0c19410463 /test/web/activity_pub/object_validators/accept_validation_test.exs
parenta0f5e8b27edbe2224d9c2c3997ad5b8ea484244b (diff)
parentb4c6b262d6dc12362f0014a864e8aed6c727c39c (diff)
downloadpleroma-1172844ed18d94d84724dc6f11c6e9f72e0ba6ec.tar.gz
pleroma-1172844ed18d94d84724dc6f11c6e9f72e0ba6ec.zip
Merge branch 'release/2.2.0' into 'stable'
Release/2.2.0 See merge request pleroma/secteam/pleroma!19
Diffstat (limited to 'test/web/activity_pub/object_validators/accept_validation_test.exs')
-rw-r--r--test/web/activity_pub/object_validators/accept_validation_test.exs56
1 files changed, 0 insertions, 56 deletions
diff --git a/test/web/activity_pub/object_validators/accept_validation_test.exs b/test/web/activity_pub/object_validators/accept_validation_test.exs
deleted file mode 100644
index d6111ba41..000000000
--- a/test/web/activity_pub/object_validators/accept_validation_test.exs
+++ /dev/null
@@ -1,56 +0,0 @@
-# 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.AcceptValidationTest do
- use Pleroma.DataCase
-
- alias Pleroma.Web.ActivityPub.Builder
- alias Pleroma.Web.ActivityPub.ObjectValidator
- alias Pleroma.Web.ActivityPub.Pipeline
-
- import Pleroma.Factory
-
- setup do
- follower = insert(:user)
- followed = insert(:user, local: false)
-
- {:ok, follow_data, _} = Builder.follow(follower, followed)
- {:ok, follow_activity, _} = Pipeline.common_pipeline(follow_data, local: true)
-
- {:ok, accept_data, _} = Builder.accept(followed, follow_activity)
-
- %{accept_data: accept_data, followed: followed}
- end
-
- test "it validates a basic 'accept'", %{accept_data: accept_data} do
- assert {:ok, _, _} = ObjectValidator.validate(accept_data, [])
- end
-
- test "it fails when the actor doesn't exist", %{accept_data: accept_data} do
- accept_data =
- accept_data
- |> Map.put("actor", "https://gensokyo.2hu/users/raymoo")
-
- assert {:error, _} = ObjectValidator.validate(accept_data, [])
- end
-
- test "it fails when the accepted activity doesn't exist", %{accept_data: accept_data} do
- accept_data =
- accept_data
- |> Map.put("object", "https://gensokyo.2hu/users/raymoo/follows/1")
-
- assert {:error, _} = ObjectValidator.validate(accept_data, [])
- end
-
- test "for an accepted follow, it only validates if the actor of the accept is the followed actor",
- %{accept_data: accept_data} do
- stranger = insert(:user)
-
- accept_data =
- accept_data
- |> Map.put("actor", stranger.ap_id)
-
- assert {:error, _} = ObjectValidator.validate(accept_data, [])
- end
-end