[OStatus] adds status to pleroma instance if the url given is a status

This commit is contained in:
Sachin Joshi 2019-04-01 22:12:02 +05:45
commit 1d01e8e656
5 changed files with 233 additions and 16 deletions

View file

@ -6,6 +6,11 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
setup do
Tesla.Mock.mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
:ok
end
describe "POST /api/pleroma/follow_import" do
test "it returns HTTP 200", %{conn: conn} do
user1 = insert(:user)
@ -164,4 +169,16 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
assert response == Jason.encode!(config |> Enum.into(%{})) |> Jason.decode!()
end
end
describe "GET /ostatus_subscribe?acct=...." do
test "adds status to pleroma instance if the `acct` is a status", %{conn: conn} do
conn =
get(
conn,
"/ostatus_subscribe?acct=https://mastodon.social/users/emelie/statuses/101849165031453009"
)
assert redirected_to(conn) =~ "/notice/"
end
end
end