From c5c9f34a5db50bbcb73fd977f90057070a51214d Mon Sep 17 00:00:00 2001 From: Simon Hughesdon Date: Wed, 20 Nov 2019 09:25:26 +0000 Subject: [PATCH] Add query params to schema.org links We're adding a query param to the links in the FAQSchema to help us measure when traffic is being referred from links parsed from the schema, and when it's coming from more traditional means. [The query param (`?foo=bar`) should go before the fragment (`#baz`)](https://tools.ietf.org/html/rfc3986#section-4.2) where applicable. --- config/machine_readable/voting-in-the-uk.yml | 26 ++++++++++---------- test/integration/guide_test.rb | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/machine_readable/voting-in-the-uk.yml b/config/machine_readable/voting-in-the-uk.yml index 092ce3f8c..444f2c300 100644 --- a/config/machine_readable/voting-in-the-uk.yml +++ b/config/machine_readable/voting-in-the-uk.yml @@ -1,6 +1,6 @@ title: "How to vote" preamble: > -

You need to register to vote before you can vote in UK elections or referendums.

+

You need to register to vote before you can vote in UK elections or referendums.

If you’re eligible, you can vote in person on the day of the election at a named polling station. You can also apply for a postal or proxy vote instead.

faqs: @@ -8,9 +8,9 @@ faqs: answer: >

You can vote:

You cannot vote online in any elections.

@@ -27,7 +27,7 @@ faqs:

You vote in person at a polling station (usually in a public building, such as a school or local hall).

Your poll card

You’ll be sent a poll card just before an election telling you when to vote and at which polling station. You can only vote at the polling station location on your card.

-

If you have not received a poll card but think you should, contact your local Electoral Registration Office.

+

If you have not received a poll card but think you should, contact your local Electoral Registration Office.

You can still vote if you’ve lost your card.

- question: When you can vote @@ -37,12 +37,12 @@ faqs: - question: ID you need to bring answer: >

If you live in England, Wales or Scotland you do not need to bring any identification to vote.

-

You will need to show photo ID to vote in Northern Ireland (your passport, driving licence, Electoral Identity Card or certain kinds of Translink Smartpass).

+

You will need to show photo ID to vote in Northern Ireland (your passport, driving licence, Electoral Identity Card or certain kinds of Translink Smartpass).

You do not have to take your poll card with you.

- question: Voting by post answer: > -

You must apply for a postal vote if you want to vote by post, for example if:

+

You must apply for a postal vote if you want to vote by post, for example if:

How to apply for a proxy vote

-

Apply for a proxy vote using a paper form. You need to send it to your local Electoral Registration Office.

+

Apply for a proxy vote using a paper form. You need to send it to your local Electoral Registration Office.

You need to apply by 5pm on 4 December to vote by proxy in the General Election in England, Scotland or Wales.

-

There’s a different form to apply to vote by proxy in Northern Ireland. Apply by 5pm on 21 November.

+

There’s a different form to apply to vote by proxy in Northern Ireland. Apply by 5pm on 21 November.

- question: Voting from abroad answer: > @@ -73,14 +73,14 @@ faqs:

If you’ll be abroad temporarily

You can vote by post or proxy if you’ll be abroad temporarily on election day, for example on holiday or a work trip.

Voting in England, Scotland or Wales

-

After you’ve registered to vote, you can apply:

+

After you’ve registered to vote, you can apply:

If you want to vote by proxy in the General Election on 12 December, apply by 5pm on 4 December.

If you want to vote by post, apply by 5pm on 26 November to get your postal voting pack. Your postal vote must then arrive at your Electoral Office in the UK by 10pm on 12 December.

Voting in Northern Ireland

-

There’s a different process to apply to vote by post or proxy if you live in Northern Ireland and will be abroad temporarily on election day.

+

There’s a different process to apply to vote by post or proxy if you live in Northern Ireland and will be abroad temporarily on election day.

If you will not have time to receive and return your postal ballot in Northern Ireland before going abroad you’ll need to vote by proxy. You cannot apply to have your postal vote sent outside the UK.

The deadline for applying for a postal or proxy vote in Northern Ireland is 5pm on 21 November.

diff --git a/test/integration/guide_test.rb b/test/integration/guide_test.rb index 61596ac0b..be8a754a1 100644 --- a/test/integration/guide_test.rb +++ b/test/integration/guide_test.rb @@ -121,7 +121,7 @@ class GuideTest < ActionDispatch::IntegrationTest assert_equal faq_schema["@type"], "FAQPage" assert_equal faq_schema["headline"], "How to vote" - assert_equal faq_schema["description"], "

You need to register to vote before you can vote in UK elections or referendums.

If you’re eligible, you can vote in person on the day of the election at a named polling station. You can also apply for a postal or proxy vote instead.

\n" + assert_equal faq_schema["description"], "

You need to register to vote before you can vote in UK elections or referendums.

If you’re eligible, you can vote in person on the day of the election at a named polling station. You can also apply for a postal or proxy vote instead.

\n" assert_equal 8, q_and_as.count end