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)
39 Pleroma.Config.put([:fe], theme: "rei-ayanami-towel")
43 |> get("/api/statusnet/config.json")
46 refute response["site"]["pleromafe"]
48 Pleroma.Config.put([:instance, :managed_config], true)
52 |> get("/api/statusnet/config.json")
55 assert response["site"]["pleromafe"]
58 test "if :pleroma, :fe is false, it returns the new style config settings", %{conn: conn} do
59 Pleroma.Config.put([:instance, :managed_config], true)
60 Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel")
61 Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"})
65 |> get("/api/statusnet/config.json")
68 assert response["site"]["pleromafe"]["theme"] == "rei-ayanami-towel"
70 Pleroma.Config.put([:fe], false)
74 |> get("/api/statusnet/config.json")
77 assert response["site"]["pleromafe"]["theme"] == "asuka-hospital"
81 describe "GET /api/pleroma/frontend_configurations" do
82 test "returns everything in :pleroma, :frontend_configurations", %{conn: conn} do
93 Pleroma.Config.put(:frontend_configurations, config)
97 |> get("/api/pleroma/frontend_configurations")
100 assert response == Jason.encode!(config |> Enum.into(%{})) |> Jason.decode!()