mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: empty uploads and blank filenames caused errors during validation
This commit is contained in:
parent
76e8a28420
commit
f525d83b53
2 changed files with 9 additions and 2 deletions
|
@ -51,6 +51,13 @@ describe Upload do
|
|||
expect(created_upload.extension).to eq("png")
|
||||
end
|
||||
|
||||
it "should create an invalid upload when the filename is blank" do
|
||||
SiteSetting.authorized_extensions = "*"
|
||||
|
||||
created_upload = UploadCreator.new(image, nil).create_for(user_id)
|
||||
expect(created_upload.valid?).to eq(false)
|
||||
end
|
||||
|
||||
context ".get_from_url" do
|
||||
let(:url) { "/uploads/default/original/3X/1/0/10f73034616a796dfd70177dc54b6def44c4ba6f.png" }
|
||||
let(:upload) { Fabricate(:upload, url: url) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue