Use destination-specific result page metadata
This commit is contained in:
parent
4de4c1d556
commit
b88d23a270
3 changed files with 31 additions and 1 deletions
|
|
@ -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&max_connection=120">' in html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue