Use destination-specific result page metadata

This commit is contained in:
Edward Betts 2026-04-01 15:33:07 +01:00
parent 4de4c1d556
commit b88d23a270
3 changed files with 31 additions and 1 deletions

View file

@ -72,3 +72,20 @@ def test_results_shows_same_day_destination_switcher(monkeypatch):
assert '/results/brussels/2026-04-10?min_connection=60&max_connection=120' in html
assert '/results/rotterdam/2026-04-10?min_connection=60&max_connection=120' in html
assert 'ES 9014' in html
def test_results_title_and_social_meta_include_destination(monkeypatch):
_stub_data(monkeypatch)
client = _client()
resp = client.get('/results/lille/2026-04-10?min_connection=60&max_connection=120')
html = resp.get_data(as_text=True)
assert resp.status_code == 200
assert '<title>Bristol to Lille Europe via Eurostar</title>' in html
assert '<meta property="og:title" content="Bristol to Lille Europe via Eurostar">' in html
assert (
'<meta property="og:description" content="Train options from Bristol Temple Meads '
'to Lille Europe on Friday 10 April 2026 via Paddington, St Pancras, and Eurostar.">'
) in html
assert '<meta property="og:url" content="http://localhost/results/lille/2026-04-10?min_connection=60&amp;max_connection=120">' in html