Handle new-style mastodon follow lists

Fixes https://git.pleroma.social/pleroma/pleroma/issues/814
This commit is contained in:
Normandy 2019-04-16 18:35:38 +00:00 committed by kaniini
commit d4a749cfb2
2 changed files with 21 additions and 1 deletions

View file

@ -26,6 +26,21 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
assert response == "job started"
end
test "it imports new-style mastodon follow lists", %{conn: conn} do
user1 = insert(:user)
user2 = insert(:user)
response =
conn
|> assign(:user, user1)
|> post("/api/pleroma/follow_import", %{
"list" => "Account address,Show boosts\n#{user2.ap_id},true"
})
|> json_response(:ok)
assert response == "job started"
end
test "requires 'follow' permission", %{conn: conn} do
token1 = insert(:oauth_token, scopes: ["read", "write"])
token2 = insert(:oauth_token, scopes: ["follow"])