defmodule ToweropsWeb.SitemapControllerTest do use ToweropsWeb.ConnCase, async: true describe "GET /sitemap.xml" do test "returns valid XML with all public pages", %{conn: conn} do conn = get(conn, "/sitemap.xml") body = response(conn, 200) assert get_resp_header(conn, "content-type") == ["text/xml; charset=utf-8"] assert body =~ ~r/<\?xml/ assert body =~ "http[^<]+/| assert body =~ "/privacy" assert body =~ "/terms" assert body =~ "/docs/api" assert body =~ "/docs/graphql" assert body =~ "/help" assert length(Regex.scan(~r//, body)) == 6 end end end