Merge branch 'preload-fixups-2' into preloadfixups
authorlain <lain@soykaf.club>
Tue, 30 Jun 2020 09:40:34 +0000 (11:40 +0200)
committerlain <lain@soykaf.club>
Tue, 30 Jun 2020 09:40:34 +0000 (11:40 +0200)
1  2 
lib/pleroma/web/preload/instance.ex
test/web/preload/instance_test.exs

index b34d7cf37218ab328bd9a70afc5d89a96c55e3dd,5c6e33e475bbce22ea884a8921bb8f8a2aa539c0..3d16f290bcbd02a90cd19f8406b75607ab8363b7
@@@ -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
index 5bb6c598117052307677186401e0da252a0c8d25,df150d7bebc1163aed7bfb7f890d5dd82ae97d76..a46f2831248626a0340dfbe0865e3f7168701d6a
@@@ -25,7 -25,18 +25,18 @@@ defmodule Pleroma.Web.Preload.Providers
             )
    end
  
 -    %{"/instance/panel.html": panel} = Instance.generate_terms(nil)
+   test "it works with overrides" do
+     clear_config([:instance, :static_dir], "test/fixtures/preload_static")
 -  test "it renders the node_info", %{"/nodeinfo/2.0": nodeinfo} do
++    %{"/instance/panel.html" => panel} = Instance.generate_terms(nil)
+     assert String.contains?(
+              panel,
+              "HEY!"
+            )
+   end
 +  test "it renders the node_info", %{"/nodeinfo/2.0.json" => nodeinfo} do
      %{
        metadata: metadata,
        version: "2.0"