summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/util_controller_test.exs
diff options
context:
space:
mode:
authorlambda <lain@soykaf.club>2019-04-02 12:47:40 +0000
committerlambda <lain@soykaf.club>2019-04-02 12:47:40 +0000
commit180b87257cae481d4d9ffc9f03a06268ad8df569 (patch)
treee74667283a46a4b2aa30657e4ef98537b54681f9 /test/web/twitter_api/util_controller_test.exs
parentce9284b36f20a7116289ce1a14aa96e31e294093 (diff)
parentf20e8d28de97e154ec43120cb4fc07e2792e955a (diff)
downloadpleroma-180b87257cae481d4d9ffc9f03a06268ad8df569.tar.gz
pleroma-180b87257cae481d4d9ffc9f03a06268ad8df569.zip
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
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r--test/web/twitter_api/util_controller_test.exs27
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