mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 10:41:25 +08:00
FIX: Don't raise an error when the img attribute cannot be found
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user