1 defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
2 use Pleroma.Web.ConnCase
6 describe "POST /api/pleroma/follow_import" do
7 test "it returns HTTP 200", %{conn: conn} do
13 |> assign(:user, user1)
14 |> post("/api/pleroma/follow_import", %{"list" => "#{user2.ap_id}"})
17 assert response == "job started"
21 describe "POST /api/pleroma/blocks_import" do
22 test "it returns HTTP 200", %{conn: conn} do
28 |> assign(:user, user1)
29 |> post("/api/pleroma/blocks_import", %{"list" => "#{user2.ap_id}"})
32 assert response == "job started"
36 describe "GET /api/statusnet/config.json" do
37 test "it returns the managed config", %{conn: conn} do
38 Pleroma.Config.put([:instance, :managed_config], false)
42 |> get("/api/statusnet/config.json")
45 refute response["site"]["pleromafe"]
47 Pleroma.Config.put([:instance, :managed_config], true)
51 |> get("/api/statusnet/config.json")
54 assert response["site"]["pleromafe"]
57 test "if :pleroma, :fe is false, it returns the new style config settings", %{conn: conn} do
58 Pleroma.Config.put([:instance, :managed_config], true)
59 Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel")
60 Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"})
64 |> get("/api/statusnet/config.json")
67 assert response["site"]["pleromafe"]["theme"] == "rei-ayanami-towel"
69 Pleroma.Config.put([:fe], false)
73 |> get("/api/statusnet/config.json")
76 assert response["site"]["pleromafe"]["theme"] == "asuka-hospital"
80 describe "GET /api/pleroma/frontend_configurations" do
81 test "returns everything in :pleroma, :frontend_configurations", %{conn: conn} do
92 Pleroma.Config.put(:frontend_configurations, config)
96 |> get("/api/pleroma/frontend_configurations")
99 assert response == Jason.encode!(config |> Enum.into(%{})) |> Jason.decode!()