mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Add spec for 4bf3bf6786
.
This commit is contained in:
@ -45,6 +45,25 @@ describe OptimizedImage do
|
||||
File.delete(tmp_path) if File.exists?(tmp_path)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when an svg with a href is masked as a png' do
|
||||
it 'should not trigger the external request' do
|
||||
tmp_path = "/tmp/resized.png"
|
||||
|
||||
begin
|
||||
expect do
|
||||
OptimizedImage.resize(
|
||||
"#{Rails.root}/spec/fixtures/images/svg.png",
|
||||
tmp_path,
|
||||
5,
|
||||
5
|
||||
)
|
||||
end.to raise_error(RuntimeError, /improper image header/)
|
||||
ensure
|
||||
File.delete(tmp_path) if File.exists?(tmp_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '.downsize' do
|
||||
|
Reference in New Issue
Block a user