Merge branch 'bugfix/share-mastodon' into 'develop'
[OStatus] adds status to pleroma instance if the url given is a status See merge request pleroma/pleroma!1002
This commit is contained in:
commit
180b87257c
6 changed files with 503 additions and 16 deletions
|
|
@ -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,26 @@ 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
|
||||
|
||||
test "show follow account page if the `acct` is a account link", %{conn: conn} do
|
||||
response =
|
||||
get(
|
||||
conn,
|
||||
"/ostatus_subscribe?acct=https://mastodon.social/users/emelie"
|
||||
)
|
||||
|
||||
assert html_response(response, 200) =~ "Log in to follow"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue