Skip to content

Commit

Permalink
Fix placeholder image bug
Browse files Browse the repository at this point in the history
It should return a hash instead of a string.
  • Loading branch information
emmabeynon committed Dec 6, 2018
1 parent 6c24f9b commit 8f6d92b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/presenters/content_item/news_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/presenters/content_item/news_image_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f6d92b

Please sign in to comment.