+ describe "GET /api/statusnet/config.json" do
+ test "it returns the managed config", %{conn: conn} do
+ Pleroma.Config.put([:instance, :managed_config], false)
+ Pleroma.Config.put([:fe], theme: "rei-ayanami-towel")
+
+ response =
+ conn
+ |> get("/api/statusnet/config.json")
+ |> json_response(:ok)
+
+ refute response["site"]["pleromafe"]
+
+ Pleroma.Config.put([:instance, :managed_config], true)
+
+ response =
+ conn
+ |> get("/api/statusnet/config.json")
+ |> json_response(:ok)
+
+ assert response["site"]["pleromafe"]
+ end
+
+ test "if :pleroma, :fe is false, it returns the new style config settings", %{conn: conn} do
+ Pleroma.Config.put([:instance, :managed_config], true)
+ Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel")
+ Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"})
+
+ response =
+ conn
+ |> get("/api/statusnet/config.json")
+ |> json_response(:ok)
+
+ assert response["site"]["pleromafe"]["theme"] == "rei-ayanami-towel"
+
+ Pleroma.Config.put([:fe], false)
+
+ 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