Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / test / 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.CacheControlTest do
6 use Pleroma.Web.ConnCase
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 max-age=86400 must-revalidate"]
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