Files
chess-endgame-trainer/test/chesstrainer_web/controllers/sitemap_controller_test.exs
T
owenrees f8897fa5ae Add French legal notice and complete privacy disclosures (#134)
- Add /mentions-legales (LCEN art. 6-III): publisher, SIRET, VAT status,
  publication director, and host details
- Name the data controller in the privacy policy and the terms
- Disclose Hetzner/Cloudflare hosting, third-country transfers, the CDN
  security cookie, and backup/suppression-list retention
- Remove the children section; the age floor now lives in the terms
- State that request logs are kept by the providers, not by us
- Mirror all changes in the pre-launch static site

The publisher address is a placeholder pending a domiciliation address.
2026-11-10 11:41:40 +01:00

28 lines
987 B
Elixir

defmodule ChesstrainerWeb.SitemapControllerTest do
use ChesstrainerWeb.ConnCase, async: true
alias ChesstrainerWeb.Endpoint
describe "GET /sitemap.xml" do
test "lists only the public marketing pages", %{conn: conn} do
body = conn |> get(~p"/sitemap.xml") |> response(200)
base_url = Endpoint.url()
assert body =~ ~s(<?xml version="1.0" encoding="UTF-8"?>)
assert body =~ ~s(<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">)
assert body =~ "<loc>#{base_url}/</loc>"
assert body =~ "<loc>#{base_url}/privacy</loc>"
assert body =~ "<loc>#{base_url}/terms-conditions</loc>"
assert body =~ "<loc>#{base_url}/mentions-legales</loc>"
assert length(:binary.matches(body, "<url>")) == 4
end
test "is served as XML", %{conn: conn} do
conn = get(conn, ~p"/sitemap.xml")
assert [content_type] = get_resp_header(conn, "content-type")
assert content_type =~ "application/xml"
end
end
end