Move the Cache Control header test to its own file
We can consolidate our cache control header tests here
This commit is contained in:
parent
6499adc6a8
commit
f916e4cdd9
2 changed files with 37 additions and 2 deletions
20
test/plugs/cache_control_test.exs
Normal file
20
test/plugs/cache_control_test.exs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.CacheControlTest do
|
||||
use Pleroma.Web.ConnCase
|
||||
alias Plug.Conn
|
||||
|
||||
test "Verify Cache-Control header on static assets", %{conn: conn} do
|
||||
conn = get(conn, "/index.html")
|
||||
|
||||
assert Conn.get_resp_header(conn, "cache-control") == ["public, no-cache"]
|
||||
end
|
||||
|
||||
test "Verify Cache-Control header on the API", %{conn: conn} do
|
||||
conn = get(conn, "/api/v1/instance")
|
||||
|
||||
assert Conn.get_resp_header(conn, "cache-control") == ["max-age=0, private, must-revalidate"]
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue