From 04448ad9350c63be5cd5accda8ae5b1b145a2a11 Mon Sep 17 00:00:00 2001 From: Jon Hallam Date: Fri, 7 Feb 2020 15:31:39 +0000 Subject: [PATCH] Remove web_isbn and print_meta_data_contact_address Trello - https://trello.com/c/w5dsqKuc/1381-remove-redundant-fields-for-whitehall-attachments-org-contact-and-web-isbn These file types are redundant and should be removed. They are no longer being sent to the publishing api by whitehall --- app/presenters/html_publication_presenter.rb | 8 -------- .../html_publication/_print_meta_data.html.erb | 12 ------------ test/integration/html_publication_test.rb | 5 ----- test/presenters/html_publication_presenter_test.rb | 2 -- 4 files changed, 27 deletions(-) diff --git a/app/presenters/html_publication_presenter.rb b/app/presenters/html_publication_presenter.rb index 566c2dbc3..501b2555f 100644 --- a/app/presenters/html_publication_presenter.rb +++ b/app/presenters/html_publication_presenter.rb @@ -7,14 +7,6 @@ def isbn content_item["details"]["isbn"] end - def web_isbn - content_item["details"]["web_isbn"] - end - - def print_meta_data_contact_address - content_item["details"]["print_meta_data_contact_address"] - end - def copyright_year content_item["details"]["public_timestamp"].to_date.year if public_timestamp.present? end diff --git a/app/views/content_items/html_publication/_print_meta_data.html.erb b/app/views/content_items/html_publication/_print_meta_data.html.erb index d7a1253a4..43ffb5e89 100644 --- a/app/views/content_items/html_publication/_print_meta_data.html.erb +++ b/app/views/content_items/html_publication/_print_meta_data.html.erb @@ -13,21 +13,9 @@

This publication is available at <%= @content_item.full_path(request) %>

-<% unless @content_item.print_meta_data_contact_address.blank? %> -

- Any enquiries regarding this publication should be sent to us at:
-

- <%= simple_format(@content_item.print_meta_data_contact_address) %> -<% end %> <% unless @content_item.isbn.blank? %>

Print ISBN: <%= @content_item.isbn %>

<% end %> - -<% unless @content_item.web_isbn.blank? %> -

- Web ISBN: <%= @content_item.web_isbn %> -

-<% end %> diff --git a/test/integration/html_publication_test.rb b/test/integration/html_publication_test.rb index 94d655b03..78ad58d30 100644 --- a/test/integration/html_publication_test.rb +++ b/test/integration/html_publication_test.rb @@ -30,10 +30,7 @@ class HtmlPublicationTest < ActionDispatch::IntegrationTest assert page.find(".print-meta-data", visible: false) assert page.has_no_text?("© Crown copyright #{@content_item['details']['public_timestamp'].to_date.year}") - assert page.has_no_text?("Any enquiries regarding this publication should be sent to us at:") - assert page.has_no_text?((@content_item["details"]["print_meta_data_contact_address"]).to_s) assert page.has_no_text?("Print ISBN: #{@content_item['details']['isbn']}") - assert page.has_no_text?("Web ISBN: #{@content_item['details']['web_isbn']}") end end @@ -44,8 +41,6 @@ class HtmlPublicationTest < ActionDispatch::IntegrationTest assert page.find(".print-meta-data", visible: true) assert page.has_text?("© Crown copyright #{@content_item['details']['public_timestamp'].to_date.year}") - assert page.has_text?("Any enquiries regarding this publication should be sent to us at:") - assert page.has_text?(:all, @content_item["details"]["print_meta_data_contact_address"].squish) assert page.has_text?("Print ISBN: #{@content_item['details']['isbn']}") end end diff --git a/test/presenters/html_publication_presenter_test.rb b/test/presenters/html_publication_presenter_test.rb index d51f72f42..58760f666 100644 --- a/test/presenters/html_publication_presenter_test.rb +++ b/test/presenters/html_publication_presenter_test.rb @@ -19,8 +19,6 @@ def schema_name test "presents the meta data info of a content item" do assert_equal schema_item("print_with_meta_data")["details"]["isbn"], presented_item("print_with_meta_data").isbn - assert_equal schema_item("print_with_meta_data")["details"]["web_isbn"], presented_item("print_with_meta_data").web_isbn - assert_equal schema_item("print_with_meta_data")["details"]["print_meta_data_contact_address"], presented_item("print_with_meta_data").print_meta_data_contact_address end test "presents the last change date" do