1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.FrontendStaticPlugTest do
6 use Pleroma.Web.ConnCase
8 @dir "test/tmp/instance_static"
12 on_exit(fn -> File.rm_rf(@dir) end)
15 setup do: clear_config([:instance, :static_dir], @dir)
17 test "overrides existing static files", %{conn: conn} do
21 clear_config([:frontends, :primary], %{"name" => name, "ref" => ref})
22 path = "#{@dir}/frontends/#{name}/#{ref}"
25 File.write!("#{path}/index.html", "from frontend plug")
27 index = get(conn, "/")
28 assert html_response(index, 200) == "from frontend plug"