Skip to content

Commit 8f6d92b

Browse files
committed
Fix placeholder image bug
It should return a hash instead of a string.
1 parent 6c24f9b commit 8f6d92b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/presenters/content_item/news_image.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def default_news_image
1212
end
1313

1414
def placeholder_image
15-
"https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg"
15+
{ "url" => "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" }
1616
end
1717
end
1818
end

test/presenters/content_item/news_image_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def initialize
3434

3535
test "presents a placeholder image if document has no image or default news image" do
3636
item = DummyContentItem.new
37-
placeholder_image = "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg"
37+
placeholder_image = { "url" => "https://assets.publishing.service.gov.uk/government/assets/placeholder.jpg" }
3838

3939
assert_equal placeholder_image, item.image
4040
end

0 commit comments

Comments
 (0)