Favicon Plug: assert HTTP 200 status in tests
This commit is contained in:
parent
662c9f36ac
commit
d0db1f00c3
1 changed files with 8 additions and 8 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue