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