From: lain Date: Tue, 30 Jun 2020 09:40:34 +0000 (+0200) Subject: Merge branch 'preload-fixups-2' into preloadfixups X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0176b7bca2e64f82228129024ac059e3bee00675;p=akkoma Merge branch 'preload-fixups-2' into preloadfixups --- 0176b7bca2e64f82228129024ac059e3bee00675 diff --cc lib/pleroma/web/preload/instance.ex index b34d7cf37,5c6e33e47..3d16f290b --- a/lib/pleroma/web/preload/instance.ex +++ b/lib/pleroma/web/preload/instance.ex @@@ -6,11 -6,12 +6,12 @@@ defmodule Pleroma.Web.Preload.Providers alias Pleroma.Web.MastodonAPI.InstanceView alias Pleroma.Web.Nodeinfo.Nodeinfo alias Pleroma.Web.Preload.Providers.Provider + alias Pleroma.Plugs.InstanceStatic @behaviour Provider - @instance_url :"/api/v1/instance" - @panel_url :"/instance/panel.html" - @nodeinfo_url :"/nodeinfo/2.0" + @instance_url "/api/v1/instance" + @panel_url "/instance/panel.html" + @nodeinfo_url "/nodeinfo/2.0.json" @impl Provider def generate_terms(_params) do diff --cc test/web/preload/instance_test.exs index 5bb6c5981,df150d7be..a46f28312 --- a/test/web/preload/instance_test.exs +++ b/test/web/preload/instance_test.exs @@@ -25,7 -25,18 +25,18 @@@ defmodule Pleroma.Web.Preload.Providers ) end + test "it works with overrides" do + clear_config([:instance, :static_dir], "test/fixtures/preload_static") + - %{"/instance/panel.html": panel} = Instance.generate_terms(nil) ++ %{"/instance/panel.html" => panel} = Instance.generate_terms(nil) + + assert String.contains?( + panel, + "HEY!" + ) + end + - test "it renders the node_info", %{"/nodeinfo/2.0": nodeinfo} do + test "it renders the node_info", %{"/nodeinfo/2.0.json" => nodeinfo} do %{ metadata: metadata, version: "2.0"