Merge branch 'feature/instance-fetch-actor' into 'develop'

instance fetch service actor

See merge request pleroma/pleroma!1440
This commit is contained in:
kaniini 2019-07-17 19:45:40 +00:00
commit 1e48af9acf
11 changed files with 103 additions and 17 deletions

View file

@ -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

View file

@ -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