diff --git a/app/main/routes.py b/app/main/routes.py index 5e1d18b87..1bf4b1af8 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -44,8 +44,8 @@ def start(): return response -@bp.get("/bsl-start") -def bsl_start(): +@bp.get("/start-bsl") +def start_bsl(): """This an entry point for the service from www.gov.uk/check-legal-aid This is a route for users who need to contact us via BSL, they are routed directly to the contact us page """ diff --git a/tests/functional_tests/test_entry_points.py b/tests/functional_tests/test_entry_points.py index 64f8eff3e..68b47bfc5 100644 --- a/tests/functional_tests/test_entry_points.py +++ b/tests/functional_tests/test_entry_points.py @@ -24,16 +24,16 @@ def test_start_route_welsh(page: Page): @pytest.mark.usefixtures("live_server") def test_bsl_route(page: Page): - url = url_for("main.bsl_start", _external=True) - assert url.endswith("/bsl-start"), url + url = url_for("main.start_bsl", _external=True) + assert url.endswith("/start-bsl"), url page.goto(url) expect(page.get_by_role("heading", name="Contact us")).to_be_visible() @pytest.mark.usefixtures("live_server") def test_bsl_route_welsh(page: Page): - url = url_for("main.bsl_start", locale="cy_GB", _external=True) - assert url.endswith("/bsl-start?locale=cy_GB"), url + url = url_for("main.start_bsl", locale="cy_GB", _external=True) + assert url.endswith("/start-bsl?locale=cy_GB"), url page.goto(url) locale = page.locator("html").get_attribute("lang") assert locale == "cy", f"Expected 'cy' but got {locale}" diff --git a/tests/unit_tests/test_entry_points.py b/tests/unit_tests/test_entry_points.py index 7eb7fa94a..6eb9b8faf 100644 --- a/tests/unit_tests/test_entry_points.py +++ b/tests/unit_tests/test_entry_points.py @@ -44,30 +44,30 @@ def test_bsl_start_clears_session(self, app, client): with client.session_transaction() as session: session["test_key"] = "test_value" - client.get("/bsl-start") + client.get("/start-bsl") with client.session_transaction() as session: assert "test_key" not in session def test_bsl_start_redirects_to_contact_us(self, client): - response = client.get("/bsl-start") + response = client.get("/start-bsl") assert response.status_code == 302 assert response.location == url_for("contact.contact_us") def test_bsl_start_sets_locale_cookie_when_provided(self, client): - response = client.get("/bsl-start?locale=cy_GB") + response = client.get("/start-bsl?locale=cy_GB") # Verify cookie is set cookies = response.headers.getlist("Set-Cookie") assert any("locale=cy" in cookie for cookie in cookies) def test_bsl_start_no_locale_cookie_when_not_provided(self, client): - response = client.get("/bsl-start") + response = client.get("/start-bsl") # Verify no locale cookie is set cookies = response.headers.getlist("Set-Cookie") assert not any("locale=" in cookie for cookie in cookies) def test_bsl_start_with_invalid_locale(self, client): - response = client.get("/bsl-start?locale=invalid") + response = client.get("/start-bsl?locale=invalid") assert response.status_code == 404