Favicon Plug: assert HTTP 200 status in tests

This commit is contained in:
Phantasm 2026-03-05 11:55:02 +01:00 committed by Phantasm
commit d0db1f00c3

View file

@ -17,16 +17,16 @@ defmodule Pleroma.Web.Plugs.FaviconPlugTest do
etag = get_resp_header(conn, "etag")
# etag changes when serving a different file
assert conn.status == 200
assert etag == ["\"72487CE\""]
assert response_content_type(conn, :png)
end
test "returns correct cache-control", %{conn: conn} do
cache =
conn
|> get("/favicon.png")
|> get_resp_header("cache-control")
conn = get(conn, "/favicon.png")
cache = get_resp_header(conn, "cache-control")
assert conn.status == 200
assert cache == ["public, max=age=86400, immutable"]
end
end
@ -53,16 +53,16 @@ defmodule Pleroma.Web.Plugs.FaviconPlugTest do
conn = get(conn, "/favicon.png")
etag = get_resp_header(conn, "etag")
assert conn.status == 200
assert etag == ["\"215A3A4\""]
assert response_content_type(conn, :png)
end
test "returns correct cache-control", %{conn: conn} do
cache =
conn
|> get("/favicon.png")
|> get_resp_header("cache-control")
conn = get(conn ,"/favicon.png")
cache = get_resp_header(conn, "cache-control")
assert conn.status == 200
assert cache == ["public, max=age=86400, immutable"]
end
end