From fb1d4a97d06c020dceef5391e330856c1c7312a8 Mon Sep 17 00:00:00 2001 From: Bevan Loon Date: Tue, 3 Dec 2019 18:21:33 +0000 Subject: [PATCH] Set history banner title from government in the links hash Instead of using the government in the details hash which we are deprecating. --- app/presenters/content_item/political.rb | 4 +++- test/presenters/publication_presenter_test.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/presenters/content_item/political.rb b/app/presenters/content_item/political.rb index 3f3e8d70a..90c209a92 100644 --- a/app/presenters/content_item/political.rb +++ b/app/presenters/content_item/political.rb @@ -5,7 +5,9 @@ def historically_political? end def publishing_government - content_item["details"]["government"]["title"] + content_item.dig( + "links", "government", 0, "title" + ) end private diff --git a/test/presenters/publication_presenter_test.rb b/test/presenters/publication_presenter_test.rb index 58f0283ee..08a3831f6 100644 --- a/test/presenters/publication_presenter_test.rb +++ b/test/presenters/publication_presenter_test.rb @@ -22,7 +22,7 @@ def schema_name end test "presents the title of the publishing government" do - assert_equal schema_item["details"]["government"]["title"], presented_item.publishing_government + assert_equal schema_item["links"]["government"][0]["title"], presented_item.publishing_government end test "content can be historically political" do