mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: IMDb links were being oneboxed as posters (#13310)
IMDb movie links were being rendered as posters. This was because IMDb was sending `og:type` as `image` randomly in some cases. To fix this we'll now default all IMDb links as article type. This will ensure that the IMDb onebox link includes all the information instead of showing just a poster without any context.
This commit is contained in:
@@ -182,4 +182,21 @@ describe Onebox::Engine::AllowlistedGenericOnebox do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'article html hosts' do
|
||||
context 'returns article_html for hosts in article_html_hosts' do
|
||||
before do
|
||||
stub_request(:get, "https://www.imdb.com/title/tt0108002/")
|
||||
.to_return(status: 200, body: onebox_response('imdb'))
|
||||
end
|
||||
|
||||
it 'shows article onebox' do
|
||||
onebox = described_class.new("https://www.imdb.com/title/tt0108002/")
|
||||
expect(onebox.to_html).to include("https://www.imdb.com/title/tt0108002")
|
||||
expect(onebox.to_html).to include("https://m.media-amazon.com/images/M/MV5BZGUzMDU1YmQtMzBkOS00MTNmLTg5ZDQtZjY5Njk4Njk2MmRlXkEyXkFqcGdeQXVyNjc1NTYyMjg@._V1_FMjpg_UX1000_.jpg")
|
||||
expect(onebox.to_html).to include("Rudy (1993) - IMDb")
|
||||
expect(onebox.to_html).to include("Rudy: Directed by David Anspaugh. With Sean Astin, Jon Favreau, Ned Beatty, Greta Lind. Rudy has always been told that he was too small to play college football.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user