mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
* Send transactional email from no-reply@mail.innersquare.app Centralise the sender identity, reply-to address and SES configuration set in Chesstrainer.Mail so no notifier can drift. Add MAIL_REDIRECT_TO for smoke tests and a mix mail.check task that exercises the SES mailbox simulators, and document the setup in the deploy guide and .env.example. * Tighten crawler metadata and keep play pages out of search Canonical URLs no longer carry query strings, public pages get an OG image, WebSite JSON-LD and a per-page language, and the sitemap dates the landing page only. Play and guest-training routes are marked noindex so tens of thousands of near-identical pages stay out of the index. * Measure built asset sizes with mix assets.sizes Report raw, gzip and brotli sizes for built JS and CSS, and record the current numbers plus the board-code split recommendation in docs/assets.md.
35 lines
1.2 KiB
Elixir
35 lines
1.2 KiB
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 =~ "<lastmod>#{Date.utc_today() |> Date.to_iso8601()}</lastmod>"
|
|
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 "only dates the landing page", %{conn: conn} do
|
|
body = conn |> get(~p"/sitemap.xml") |> response(200)
|
|
|
|
assert length(:binary.matches(body, "<lastmod>")) == 1
|
|
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
|