diff --git a/app/presenters/content_item/news_image.rb b/app/presenters/content_item/news_image.rb index 595b7a5ce..7aa3a6cbc 100644 --- a/app/presenters/content_item/news_image.rb +++ b/app/presenters/content_item/news_image.rb @@ -13,7 +13,11 @@ def default_news_image def placeholder_image # this image has been uploaded to asset-manager - { "url" => "https://assets.publishing.service.gov.uk/media/5e59279b86650c53b2cefbfe/placeholder.jpg" } + if content_item.dig("document_type") == "world_news_story" + { "url" => "https://assets.publishing.service.gov.uk/media/5e985599d3bf7f3fc943bbd8/UK_government_logo.jpg" } + else + { "url" => "https://assets.publishing.service.gov.uk/media/5e59279b86650c53b2cefbfe/placeholder.jpg" } + end end end end diff --git a/test/presenters/content_item/news_image_test.rb b/test/presenters/content_item/news_image_test.rb index 070dbd8d7..b79f5e103 100644 --- a/test/presenters/content_item/news_image_test.rb +++ b/test/presenters/content_item/news_image_test.rb @@ -38,4 +38,12 @@ def initialize assert_equal placeholder_image, item.image end + + test "presents a placeholder image if world location news has no image or default news image" do + item = DummyContentItem.new + item.content_item["document_type"] = "world_news_story" + placeholder_image = { "url" => "https://assets.publishing.service.gov.uk/media/5e985599d3bf7f3fc943bbd8/UK_government_logo.jpg" } + + assert_equal placeholder_image, item.image + end end