From 1e01d23d7b68489e3f77bb7763f74914a5368f47 Mon Sep 17 00:00:00 2001 From: George Schena Date: Fri, 18 Oct 2024 15:49:44 +0100 Subject: [PATCH] Remove help page presenter, views and tests --- app/presenters/help_page_presenter.rb | 4 ---- app/views/content_items/help_page.html.erb | 10 -------- test/integration/help_page_test.rb | 26 --------------------- test/presenters/help_page_presenter_test.rb | 15 ------------ 4 files changed, 55 deletions(-) delete mode 100644 app/presenters/help_page_presenter.rb delete mode 100644 app/views/content_items/help_page.html.erb delete mode 100644 test/integration/help_page_test.rb delete mode 100644 test/presenters/help_page_presenter_test.rb diff --git a/app/presenters/help_page_presenter.rb b/app/presenters/help_page_presenter.rb deleted file mode 100644 index efa29accd..000000000 --- a/app/presenters/help_page_presenter.rb +++ /dev/null @@ -1,4 +0,0 @@ -class HelpPagePresenter < ContentItemPresenter - include ContentItem::Body - include ContentItem::LastUpdated -end diff --git a/app/views/content_items/help_page.html.erb b/app/views/content_items/help_page.html.erb deleted file mode 100644 index 8b60b5364..000000000 --- a/app/views/content_items/help_page.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% content_for :extra_head_content do %> - <%= 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 deleted file mode 100644 index a550b9cd1..000000000 --- a/test/integration/help_page_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "test_helper" - -class HelpPageTest < ActionDispatch::IntegrationTest - test "renders title and body" do - setup_and_visit_content_item("help_page") - - assert page.has_text?(@content_item["title"]) - 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" - stub_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 - - test "does not render with the single page notification button" do - setup_and_visit_content_item("help_page") - assert_not page.has_css?(".gem-c-single-page-notification-button") - end -end diff --git a/test/presenters/help_page_presenter_test.rb b/test/presenters/help_page_presenter_test.rb deleted file mode 100644 index af71a73ec..000000000 --- a/test/presenters/help_page_presenter_test.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "presenter_test_helper" - -class HelpPagePresenterTest < PresenterTestCase - def schema_name - "help_page" - end - - test "presents the title" do - assert_equal schema_item["title"], presented_item.title - end - - test "presents the body" do - assert_equal schema_item["details"]["body"], presented_item.body - end -end