diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-24 15:21:40 +0400 | 
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-24 15:21:40 +0400 | 
| commit | 3189c44a0cf6821976819112e93e93ad811cba53 (patch) | |
| tree | b3f0964414bf834435bad44124aecadef159f669 /test | |
| parent | fbf02a372254940c16908ef608e67fd28cfa4bf0 (diff) | |
| download | pleroma-3189c44a0cf6821976819112e93e93ad811cba53.tar.gz pleroma-3189c44a0cf6821976819112e93e93ad811cba53.zip | |
Remove some TwitterAPI endpoints
Diffstat (limited to 'test')
| -rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 121 | 
1 files changed, 0 insertions, 121 deletions
| diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 30e54bebd..5ad682b0b 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -177,105 +177,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do      end    end -  describe "GET /api/statusnet/config" do -    test "it returns config in xml format", %{conn: conn} do -      instance = Config.get(:instance) - -      response = -        conn -        |> put_req_header("accept", "application/xml") -        |> get("/api/statusnet/config") -        |> response(:ok) - -      assert response == -               "<config>\n<site>\n<name>#{Keyword.get(instance, :name)}</name>\n<site>#{ -                 Pleroma.Web.base_url() -               }</site>\n<textlimit>#{Keyword.get(instance, :limit)}</textlimit>\n<closed>#{ -                 !Keyword.get(instance, :registrations_open) -               }</closed>\n</site>\n</config>\n" -    end - -    test "it returns config in json format", %{conn: conn} do -      instance = Config.get(:instance) -      Config.put([:instance, :managed_config], true) -      Config.put([:instance, :registrations_open], false) -      Config.put([:instance, :invites_enabled], true) -      Config.put([:instance, :public], false) -      Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"}) - -      response = -        conn -        |> put_req_header("accept", "application/json") -        |> get("/api/statusnet/config") -        |> json_response(:ok) - -      expected_data = %{ -        "site" => %{ -          "accountActivationRequired" => "0", -          "closed" => "1", -          "description" => Keyword.get(instance, :description), -          "invitesEnabled" => "1", -          "name" => Keyword.get(instance, :name), -          "pleromafe" => %{"theme" => "asuka-hospital"}, -          "private" => "1", -          "safeDMMentionsEnabled" => "0", -          "server" => Pleroma.Web.base_url(), -          "textlimit" => to_string(Keyword.get(instance, :limit)), -          "uploadlimit" => %{ -            "avatarlimit" => to_string(Keyword.get(instance, :avatar_upload_limit)), -            "backgroundlimit" => to_string(Keyword.get(instance, :background_upload_limit)), -            "bannerlimit" => to_string(Keyword.get(instance, :banner_upload_limit)), -            "uploadlimit" => to_string(Keyword.get(instance, :upload_limit)) -          }, -          "vapidPublicKey" => Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key) -        } -      } - -      assert response == expected_data -    end - -    test "returns the state of safe_dm_mentions flag", %{conn: conn} do -      Config.put([:instance, :safe_dm_mentions], true) - -      response = -        conn -        |> get("/api/statusnet/config.json") -        |> json_response(:ok) - -      assert response["site"]["safeDMMentionsEnabled"] == "1" - -      Config.put([:instance, :safe_dm_mentions], false) - -      response = -        conn -        |> get("/api/statusnet/config.json") -        |> json_response(:ok) - -      assert response["site"]["safeDMMentionsEnabled"] == "0" -    end - -    test "it returns the managed config", %{conn: conn} do -      Config.put([:instance, :managed_config], false) -      Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"}) - -      response = -        conn -        |> get("/api/statusnet/config.json") -        |> json_response(:ok) - -      refute response["site"]["pleromafe"] - -      Config.put([:instance, :managed_config], true) - -      response = -        conn -        |> get("/api/statusnet/config.json") -        |> json_response(:ok) - -      assert response["site"]["pleromafe"] == %{"theme" => "asuka-hospital"} -    end -  end -    describe "GET /api/pleroma/frontend_configurations" do      test "returns everything in :pleroma, :frontend_configurations", %{conn: conn} do        config = [ @@ -404,28 +305,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do      end    end -  describe "GET /api/statusnet/version" do -    test "it returns version in xml format", %{conn: conn} do -      response = -        conn -        |> put_req_header("accept", "application/xml") -        |> get("/api/statusnet/version") -        |> response(:ok) - -      assert response == "<version>#{Pleroma.Application.named_version()}</version>" -    end - -    test "it returns version in json format", %{conn: conn} do -      response = -        conn -        |> put_req_header("accept", "application/json") -        |> get("/api/statusnet/version") -        |> json_response(:ok) - -      assert response == "#{Pleroma.Application.named_version()}" -    end -  end -    describe "POST /main/ostatus - remote_subscribe/2" do      setup do: clear_config([:instance, :federating], true) | 
