1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Preload.Providers.InstanceTest do
7 alias Pleroma.Web.Preload.Providers.Instance
9 setup do: {:ok, Instance.generate_terms(nil)}
11 test "it renders the info", %{"/api/v1/instance" => info} do
13 description: description,
14 email: "admin@example.com",
18 assert String.equivalent?(description, "Pleroma: An efficient and flexible fediverse server")
21 test "it renders the panel", %{"/instance/panel.html" => panel} do
22 assert String.contains?(
24 "<p>Welcome to <a href=\"https://pleroma.social\" target=\"_blank\">Pleroma!</a></p>"
28 test "it works with overrides" do
29 clear_config([:instance, :static_dir], "test/fixtures/preload_static")
31 %{"/instance/panel.html" => panel} = Instance.generate_terms(nil)
33 assert String.contains?(
39 test "it renders the node_info", %{"/nodeinfo/2.0.json" => nodeinfo} do
45 assert metadata.private == false
46 assert metadata.suggestions == %{enabled: false}
49 test "it renders the frontend configurations", %{
50 "/api/pleroma/frontend_configurations" => fe_configs
53 pleroma_fe: %{background: "/images/city.jpg", logo: "/static/logo.svg"}