diff options
author | Sachin Joshi <satchin.joshi@gmail.com> | 2019-04-01 22:12:02 +0545 |
---|---|---|
committer | Sachin Joshi <satchin.joshi@gmail.com> | 2019-04-01 22:26:58 +0545 |
commit | 1d01e8e656c364b97b9ee36a6173a830d3f5f4fc (patch) | |
tree | 8b7fb86f0a2bf63a8409e8214bca19fd8e76f95a /test/web/twitter_api/util_controller_test.exs | |
parent | 9e3899bf36cea47560c5de1d4787125f6296a3b8 (diff) | |
download | pleroma-1d01e8e656c364b97b9ee36a6173a830d3f5f4fc.tar.gz pleroma-1d01e8e656c364b97b9ee36a6173a830d3f5f4fc.zip |
[OStatus] adds status to pleroma instance if the url given is a status
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 17 |
1 files changed, 17 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..f4a3ce501 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,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 |