aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaniini <ariadne@dereferenced.org>2019-07-17 19:45:40 +0000
committerkaniini <ariadne@dereferenced.org>2019-07-17 19:45:40 +0000
commit1e48af9acf01bf66bd03babccbf08089eb909788 (patch)
tree1b46b3fc06b7615666fcdcea30568034439fe071 /test
parent60b54ee64a9130dd4a3245b90ab49943a9e881c6 (diff)
parentc1198351022ead54b8de3bc535df32e333eb9b4d (diff)
downloadpleroma-1e48af9acf01bf66bd03babccbf08089eb909788.tar.gz
Merge branch 'feature/instance-fetch-actor' into 'develop'
instance fetch service actor See merge request pleroma/pleroma!1440
Diffstat (limited to 'test')
-rw-r--r--test/user_test.exs17
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs11
2 files changed, 28 insertions, 0 deletions
diff --git a/test/user_test.exs b/test/user_test.exs
index 264b7a40e..908f72a0e 100644
--- a/test/user_test.exs
+++ b/test/user_test.exs
@@ -1310,4 +1310,21 @@ defmodule Pleroma.UserTest do
assert following == 0
end
end
+
+ describe "is_internal_user?/1" do
+ test "non-internal user returns false" do
+ user = insert(:user)
+ refute User.is_internal_user?(user)
+ end
+
+ test "user with no nickname returns true" do
+ user = insert(:user, %{nickname: nil})
+ assert User.is_internal_user?(user)
+ end
+
+ test "user with internal-prefixed nickname returns true" do
+ user = insert(:user, %{nickname: "internal.test"})
+ assert User.is_internal_user?(user)
+ end
+ end
end
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs
index 452172bb4..40344f17e 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -48,6 +48,17 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
end
end
+ describe "/internal/fetch" do
+ test "it returns the internal fetch user", %{conn: conn} do
+ res =
+ conn
+ |> get(activity_pub_path(conn, :internal_fetch))
+ |> json_response(200)
+
+ assert res["id"] =~ "/fetch"
+ end
+ end
+
describe "/users/:nickname" do
test "it returns a json representation of the user with accept application/json", %{
conn: conn