diff --git a/app/views/content_items/help_page.html.erb b/app/views/content_items/help_page.html.erb index 1cdf8c43d..8b60b5364 100644 --- a/app/views/content_items/help_page.html.erb +++ b/app/views/content_items/help_page.html.erb @@ -2,6 +2,9 @@ <%= machine_readable_metadata( schema: :article ) %> + <% if @content_item.base_path == '/help/cookie-details' %> + + <% end %> <% end %> <%= render 'content_items/body_with_related_links' %> diff --git a/test/integration/help_page_test.rb b/test/integration/help_page_test.rb index a294f09bf..88e1adf89 100644 --- a/test/integration/help_page_test.rb +++ b/test/integration/help_page_test.rb @@ -8,4 +8,14 @@ class HelpPageTest < ActionDispatch::IntegrationTest assert page.has_text?("GOV.UK puts small files (known as ‘cookies’) onto your computer to collect information about how you browse the site.") assert_has_published_dates(@content_item["last_updated"]) end + + test "sets noindex meta tag for '/help/cookie-details'" do + @content_item = get_content_example("help_page").tap do |item| + item["base_path"] = "/help/cookie-details" + content_store_has_item(item["base_path"], item.to_json) + visit_with_cachebust(item["base_path"]) + end + + assert page.has_css?('meta[name="robots"][content="noindex"]', visible: false) + end end