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