You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The polls close at 10:00pm, so we should turn the hardcoded schema off at
that time.
Updates to the content are scheduled to be published at that time too, so
the cache will be cleared by our standard processes.
Copy file name to clipboardExpand all lines: test/integration/guide_test.rb
+54-13
Original file line number
Diff line number
Diff line change
@@ -113,28 +113,69 @@ class GuideTest < ActionDispatch::IntegrationTest
113
113
end
114
114
115
115
# The schema config is in /config/machine_readable/how-to-vote.yml
116
-
test"voting in the UK guide shows hard coded FAQ schema"do
117
-
setup_and_visit_voting_guide
116
+
test"voting in the UK guide shows hard coded FAQ schema until voting closes"do
117
+
when_voting_is_opendo
118
+
setup_and_visit_voting_guide
118
119
119
-
faq_schema=find_structured_data(page,"FAQPage")
120
-
q_and_as=faq_schema["mainEntity"]
120
+
faq_schema=find_structured_data(page,"FAQPage")
121
+
q_and_as=faq_schema["mainEntity"]
121
122
122
-
assert_equalfaq_schema["@type"],"FAQPage"
123
-
assert_equalfaq_schema["headline"],"How to vote"
124
-
assert_equalfaq_schema["description"],"<p>You need to <a href=\"/register-to-vote?src=schema\">register to vote</a> before you can vote in UK elections or referendums.</p> <p>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.</p> <p>There are elections and referendums in England, Scotland and Wales on 6 May 2021.</p>\n"
123
+
assert_equalfaq_schema["@type"],"FAQPage"
124
+
assert_equalfaq_schema["headline"],"How to vote"
125
+
assert_equalfaq_schema["description"],"<p>You need to <a href=\"/register-to-vote?src=schema\">register to vote</a> before you can vote in UK elections or referendums.</p> <p>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.</p> <p>There are elections and referendums in England, Scotland and Wales on 6 May 2021.</p>\n"
126
+
127
+
assert_equal10,q_and_as.count
128
+
end
129
+
end
130
+
131
+
test"voting in the UK guide shows all chapters on a single page until voting closes"do
0 commit comments