From 8f6d92b32ca44a217d35d6ffc7022f9f1becc753 Mon Sep 17 00:00:00 2001 From: Emma Beynon Date: Thu, 6 Dec 2018 14:48:18 +0000 Subject: [PATCH] Fix placeholder image bug It should return a hash instead of a string. --- app/presenters/content_item/news_image.rb | 2 +- test/presenters/content_item/news_image_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/presenters/content_item/news_image.rb b/app/presenters/content_item/news_image.rb index 237330f33..0a49663a5 100644 --- a/app/presenters/content_item/news_image.rb +++ b/app/presenters/content_item/news_image.rb @@ -12,7 +12,7 @@ def default_news_image end def placeholder_image - "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" + { "url" => "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" } end end end diff --git a/test/presenters/content_item/news_image_test.rb b/test/presenters/content_item/news_image_test.rb index 76fdd105f..98efa8e99 100644 --- a/test/presenters/content_item/news_image_test.rb +++ b/test/presenters/content_item/news_image_test.rb @@ -34,7 +34,7 @@ def initialize test "presents a placeholder image if document has no image or default news image" do item = DummyContentItem.new - placeholder_image = "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" + placeholder_image = { "url" => "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" } assert_equal placeholder_image, item.image end