- <%= render 'govuk_component/title', title: 'Coming soon' %>
+ <%= render 'govuk_publishing_components/components/title', title: 'Coming soon' %>
This document will be published on
diff --git a/app/views/content_items/consultation.html.erb b/app/views/content_items/consultation.html.erb
index 999e96331..ceda203f3 100644
--- a/app/views/content_items/consultation.html.erb
+++ b/app/views/content_items/consultation.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/contact.html.erb b/app/views/content_items/contact.html.erb
index 9b3c64ee0..e4b607549 100644
--- a/app/views/content_items/contact.html.erb
+++ b/app/views/content_items/contact.html.erb
@@ -8,7 +8,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
diff --git a/app/views/content_items/corporate_information_page.html.erb b/app/views/content_items/corporate_information_page.html.erb
index 4c988da47..90fb7f188 100644
--- a/app/views/content_items/corporate_information_page.html.erb
+++ b/app/views/content_items/corporate_information_page.html.erb
@@ -34,7 +34,7 @@
- <%= render 'govuk_component/title', title: @content_item.title %>
+ <%= render 'govuk_publishing_components/components/title', title: @content_item.title %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb
index b7fa406fe..ef1996a6a 100644
--- a/app/views/content_items/detailed_guide.html.erb
+++ b/app/views/content_items/detailed_guide.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/document_collection.html.erb b/app/views/content_items/document_collection.html.erb
index 7ad2c6665..f89d335e5 100644
--- a/app/views/content_items/document_collection.html.erb
+++ b/app/views/content_items/document_collection.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title',
+ <%= render 'govuk_publishing_components/components/title',
context: t("content_item.schema_name.#{@content_item.document_type}", count: 1),
title: @content_item.title,
average_title_length: "long" %>
diff --git a/app/views/content_items/fatality_notice.html.erb b/app/views/content_items/fatality_notice.html.erb
index 87eea550f..a7571105e 100644
--- a/app/views/content_items/fatality_notice.html.erb
+++ b/app/views/content_items/fatality_notice.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/gone.html.erb b/app/views/content_items/gone.html.erb
index d14ad84fc..4ae9cf2b8 100644
--- a/app/views/content_items/gone.html.erb
+++ b/app/views/content_items/gone.html.erb
@@ -1,6 +1,6 @@
- <%= render 'govuk_component/title', title: 'The page you\'re looking for is no longer available' %>
+ <%= render 'govuk_publishing_components/components/title', title: 'The page you\'re looking for is no longer available' %>
The information on this page has been removed because it was published in error.
diff --git a/app/views/content_items/guide.html+print.erb b/app/views/content_items/guide.html+print.erb
index e84a7030b..34c7e3f41 100644
--- a/app/views/content_items/guide.html+print.erb
+++ b/app/views/content_items/guide.html+print.erb
@@ -8,7 +8,7 @@
- <%= render 'govuk_component/title', { title: @content_item.title } %>
+ <%= render 'govuk_publishing_components/components/title', { title: @content_item.title } %>
<% @content_item.parts.each_with_index do |part, index| %>
diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb
index e5d3f565b..2312a21f4 100644
--- a/app/views/content_items/guide.html.erb
+++ b/app/views/content_items/guide.html.erb
@@ -9,7 +9,7 @@
- <%= render 'govuk_component/title', { title: @content_item.title } %>
+ <%= render 'govuk_publishing_components/components/title', { title: @content_item.title } %>
<% if @content_item.multi_page_guide? %>
<%= render "govuk_publishing_components/components/contents_list", aria_label: 'Pages in this guide', contents: @content_item.part_link_elements, underline_links: true %>
diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb
index 309f08e03..9cee9496d 100644
--- a/app/views/content_items/html_publication.html.erb
+++ b/app/views/content_items/html_publication.html.erb
@@ -19,7 +19,7 @@
<%= render 'govuk_publishing_components/components/inverse_header', {} do %>
- <%= render 'govuk_component/title',
+ <%= render 'govuk_publishing_components/components/title',
title: @content_item.title,
context: I18n.t("content_item.schema_name.#{@content_item.format_sub_type}", count: 1),
inverse: true,
diff --git a/app/views/content_items/news_article.html.erb b/app/views/content_items/news_article.html.erb
index 1ae6441b5..d7af938f6 100644
--- a/app/views/content_items/news_article.html.erb
+++ b/app/views/content_items/news_article.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/publication.html.erb b/app/views/content_items/publication.html.erb
index 3a5bc32f9..4f3020a59 100644
--- a/app/views/content_items/publication.html.erb
+++ b/app/views/content_items/publication.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title',
+ <%= render 'govuk_publishing_components/components/title',
context: t("content_item.schema_name.#{@content_item.document_type}", count: 1),
title: @content_item.title,
average_title_length: "long" %>
diff --git a/app/views/content_items/service_sign_in/_choose_sign_in.html.erb b/app/views/content_items/service_sign_in/_choose_sign_in.html.erb
index b772eb100..3d23e28c0 100644
--- a/app/views/content_items/service_sign_in/_choose_sign_in.html.erb
+++ b/app/views/content_items/service_sign_in/_choose_sign_in.html.erb
@@ -17,7 +17,7 @@
<% end %>
<%= form_tag({controller: 'content_items', action: 'service_sign_in_options'}, method: "post", data: { module: 'track-radio-group' }) do %>
- <% legend_text = render 'govuk_component/title', title: @content_item.title %>
+ <% legend_text = render 'govuk_publishing_components/components/title', title: @content_item.title %>
<%= render "govuk_publishing_components/components/fieldset", legend_text: legend_text do %>
diff --git a/app/views/content_items/service_sign_in/_create_new_account.html.erb b/app/views/content_items/service_sign_in/_create_new_account.html.erb
index 5c84e8d94..2ed5b180c 100644
--- a/app/views/content_items/service_sign_in/_create_new_account.html.erb
+++ b/app/views/content_items/service_sign_in/_create_new_account.html.erb
@@ -2,7 +2,7 @@
- <%= render 'govuk_component/title', title: @content_item.title %>
+ <%= render 'govuk_publishing_components/components/title', title: @content_item.title %>
<%= render 'govuk_publishing_components/components/govspeak', content: @content_item.body %>
diff --git a/app/views/content_items/specialist_document.html.erb b/app/views/content_items/specialist_document.html.erb
index 7a78083a6..730f5b894 100644
--- a/app/views/content_items/specialist_document.html.erb
+++ b/app/views/content_items/specialist_document.html.erb
@@ -8,7 +8,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/speech.html.erb b/app/views/content_items/speech.html.erb
index a50832e0f..147affb48 100644
--- a/app/views/content_items/speech.html.erb
+++ b/app/views/content_items/speech.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/statistical_data_set.html.erb b/app/views/content_items/statistical_data_set.html.erb
index d0d52e917..3494a1b43 100644
--- a/app/views/content_items/statistical_data_set.html.erb
+++ b/app/views/content_items/statistical_data_set.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title',
+ <%= render 'govuk_publishing_components/components/title',
context: t("content_item.schema_name.#{@content_item.document_type}", count: 1),
title: @content_item.title,
average_title_length: "long" %>
diff --git a/app/views/content_items/statistics_announcement.html.erb b/app/views/content_items/statistics_announcement.html.erb
index f43793472..a33665ef4 100644
--- a/app/views/content_items/statistics_announcement.html.erb
+++ b/app/views/content_items/statistics_announcement.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'govuk_publishing_components/components/lead_paragraph', text: @content_item.description %>
diff --git a/app/views/content_items/take_part.html.erb b/app/views/content_items/take_part.html.erb
index ae82dc927..1f9d150cd 100644
--- a/app/views/content_items/take_part.html.erb
+++ b/app/views/content_items/take_part.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'govuk_publishing_components/components/lead_paragraph', text: @content_item.description %>
diff --git a/app/views/content_items/travel_advice.html+print.erb b/app/views/content_items/travel_advice.html+print.erb
index 9cdf49f50..e2a687ddb 100644
--- a/app/views/content_items/travel_advice.html+print.erb
+++ b/app/views/content_items/travel_advice.html+print.erb
@@ -8,7 +8,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<% @content_item.parts.each_with_index do |part, i| %>
diff --git a/app/views/content_items/travel_advice.html.erb b/app/views/content_items/travel_advice.html.erb
index 6999e1434..ca2cfabd5 100644
--- a/app/views/content_items/travel_advice.html.erb
+++ b/app/views/content_items/travel_advice.html.erb
@@ -14,7 +14,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
diff --git a/app/views/content_items/unpublishing.html.erb b/app/views/content_items/unpublishing.html.erb
index 7aa04cc10..fb9527cc3 100644
--- a/app/views/content_items/unpublishing.html.erb
+++ b/app/views/content_items/unpublishing.html.erb
@@ -1,6 +1,6 @@
- <%= render 'govuk_component/title', title: 'The page you\'re looking for is no longer available' %>
+ <%= render 'govuk_publishing_components/components/title', title: 'The page you\'re looking for is no longer available' %>
The information on this page has been removed because it was published in error.
diff --git a/app/views/content_items/working_group.html.erb b/app/views/content_items/working_group.html.erb
index bbf10145f..b22265450 100644
--- a/app/views/content_items/working_group.html.erb
+++ b/app/views/content_items/working_group.html.erb
@@ -22,7 +22,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/content_items/world_location_news_article.html.erb b/app/views/content_items/world_location_news_article.html.erb
index 8f65c24a6..7ab79c040 100644
--- a/app/views/content_items/world_location_news_article.html.erb
+++ b/app/views/content_items/world_location_news_article.html.erb
@@ -6,7 +6,7 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/app/views/development/index.html.erb b/app/views/development/index.html.erb
index 4cdf55833..690948adc 100644
--- a/app/views/development/index.html.erb
+++ b/app/views/development/index.html.erb
@@ -8,7 +8,7 @@
- <%= render 'govuk_component/title', title: 'government-frontend' %>
+ <%= render 'govuk_publishing_components/components/title', title: 'government-frontend' %>
<% html = capture do %>
diff --git a/app/views/shared/_title_and_translations.html.erb b/app/views/shared/_title_and_translations.html.erb
index 55fa7c969..54b783987 100644
--- a/app/views/shared/_title_and_translations.html.erb
+++ b/app/views/shared/_title_and_translations.html.erb
@@ -1,6 +1,6 @@
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
<%= render 'shared/translations' %>
diff --git a/test/integration/fatality_notice_test.rb b/test/integration/fatality_notice_test.rb
index d7e4ff1db..b892765d7 100644
--- a/test/integration/fatality_notice_test.rb
+++ b/test/integration/fatality_notice_test.rb
@@ -15,7 +15,7 @@ class FatalityNoticeTest < ActionDispatch::IntegrationTest
visible: false
)
- assert_component_parameter("title", "context", "Operations in Zululand")
+ assert page.has_content?("Operations in Zululand")
assert_has_component_title("Sir George Pomeroy Colley killed in Boer War")
refute page.has_css?(".gem-c-notice")
diff --git a/test/integration/service_sign_in/choose_sign_in_test.rb b/test/integration/service_sign_in/choose_sign_in_test.rb
index 04d62c5a9..b209ae317 100644
--- a/test/integration/service_sign_in/choose_sign_in_test.rb
+++ b/test/integration/service_sign_in/choose_sign_in_test.rb
@@ -25,9 +25,7 @@ class ChooseSignInTest < ActionDispatch::IntegrationTest
within "#content form" do
within ".gem-c-fieldset" do
within ".gem-c-fieldset__legend" do
- within shared_component_selector('title') do
- assert page.has_text?("Prove your identity to continue")
- end
+ assert_has_component_title "Prove your identity to continue"
end
within ".gem-c-govspeak" do
@@ -85,9 +83,7 @@ class ChooseSignInTest < ActionDispatch::IntegrationTest
within "#content form" do
within ".gem-c-fieldset" do
within ".gem-c-fieldset__legend" do
- within shared_component_selector('title') do
- assert page.has_text?("Profwch pwy ydych chi i fwrw ymlaen")
- end
+ assert_has_component_title "Profwch pwy ydych chi i fwrw ymlaen"
end
within ".gem-c-govspeak" do
diff --git a/test/integration/service_sign_in/create_new_account_test.rb b/test/integration/service_sign_in/create_new_account_test.rb
index 17d29b7b4..1c117da1a 100644
--- a/test/integration/service_sign_in/create_new_account_test.rb
+++ b/test/integration/service_sign_in/create_new_account_test.rb
@@ -21,9 +21,8 @@ class CreateNewAccount < ActionDispatch::IntegrationTest
setup_and_visit_create_new_account_page
assert page.has_css?("title", text: 'Create an account - GOV.UK', visible: false)
- within shared_component_selector('title') do
- assert page.has_text?("Create an account")
- end
+
+ assert_has_component_title "Create an account"
assert page.has_text?("To use this service, you need to create either a Government Gateway or GOV.UK Verify account. These are used to help fight identity theft.")
assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false)
diff --git a/test/integration/specialist_document_test.rb b/test/integration/specialist_document_test.rb
index 268cc3676..8f696cb80 100644
--- a/test/integration/specialist_document_test.rb
+++ b/test/integration/specialist_document_test.rb
@@ -30,7 +30,7 @@ class SpecialistDocumentTest < ActionDispatch::IntegrationTest
test "renders title, description and body" do
setup_and_visit_content_item('aaib-reports')
- assert_has_component_title(@content_item["title"])
+ assert_has_component_title(@content_item["title"].strip)
assert page.has_text?(@content_item["description"])
assert page.has_text?("The gyroplane began to move forward against the brakes before sufficient rotor rpm had been achieved for takeoff.")
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index d45a6ec42..69bf3609e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -78,9 +78,7 @@ def assert_component_parameter(component, label, value)
end
def assert_has_component_title(title)
- within shared_component_selector("title") do
- assert_equal title, JSON.parse(page.text).fetch("title")
- end
+ assert page.has_css?('h1', text: title)
end
def assert_has_component_organisation_logo(logo, index = 1)