FIX: Don't raise an error when the img attribute cannot be found

This commit is contained in:
Robin Ward
2017-05-08 15:35:31 -04:00
parent afe04b8bbb
commit 009e120e13
2 changed files with 9 additions and 0 deletions

View File

@ -310,6 +310,12 @@ describe CookedPostProcessor do
expect(cpp.get_size_from_attributes(img)).to eq([33, 100])
end
it "doesn't raise an error with a weird url" do
img = { 'src' => nil, 'height' => 100}
SiteSetting.stubs(:crawl_images?).returns(true)
expect(cpp.get_size_from_attributes(img)).to be_nil
end
end
context ".get_size_from_image_sizes" do