diff options
author | lain <lain@soykaf.club> | 2019-04-02 16:10:38 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-04-02 16:10:38 +0200 |
commit | 39bcf93007a5a52ba374099d6b04692361e7fa9b (patch) | |
tree | 358becb7f089c62d9f2a2634ca766ee7e7bad3f3 /test/web/twitter_api/util_controller_test.exs | |
parent | fd07745d1b18e2a1eeb88a99eaa9d5e728d1aa71 (diff) | |
parent | 180b87257cae481d4d9ffc9f03a06268ad8df569 (diff) | |
download | pleroma-39bcf93007a5a52ba374099d6b04692361e7fa9b.tar.gz pleroma-39bcf93007a5a52ba374099d6b04692361e7fa9b.zip |
Merge remote-tracking branch 'origin/develop' into fix-slow-relationships
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 832fdc096..e4dd97d46 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -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 |