diff options
author | Alex S <alex.strizhakov@gmail.com> | 2019-04-02 20:39:52 +0700 |
---|---|---|
committer | Alex S <alex.strizhakov@gmail.com> | 2019-04-02 20:39:52 +0700 |
commit | fa8483cb808ef4b8b907d7ec0eeb882f3f47d927 (patch) | |
tree | c710d397bb2c189026eee910ee910384abb8eab9 /test/web/twitter_api/util_controller_test.exs | |
parent | d140738edf75467420b35c500716cf89de66548d (diff) | |
parent | 180b87257cae481d4d9ffc9f03a06268ad8df569 (diff) | |
download | pleroma-fa8483cb808ef4b8b907d7ec0eeb882f3f47d927.tar.gz pleroma-fa8483cb808ef4b8b907d7ec0eeb882f3f47d927.zip |
Merging develop into feature/770-add-emoji-tags
Conflict test/web/twitter_api/util_controller_test.exs
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 1063ad28f..410f20f87 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) @@ -185,4 +190,26 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do assert is_list(tags) 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 |