Merge remote-tracking branch 'upstream/develop' into aliases
[akkoma] / test / pleroma / web / plugs / cache_control_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.Plugs.CacheControlTest do
6 use Pleroma.Web.ConnCase, async: true
7 alias Plug.Conn
8
9 test "Verify Cache-Control header on static assets", %{conn: conn} do
10 conn = get(conn, "/index.html")
11
12 assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
13 end
14
15 test "Verify Cache-Control header on the API", %{conn: conn} do
16 conn = get(conn, "/api/v1/instance")
17
18 assert Conn.get_resp_header(conn, "cache-control") == ["max-age=0, private, must-revalidate"]
19 end
20 end