2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

Fix backend code for searching by a filetype as a combination of uploads and topic links. Add rspec test for extracting file extension in upload.

This commit is contained in:
Jakub Macina 2017-07-04 17:50:08 +02:00
parent f0a674d620
commit 8c445e9f17
4 changed files with 11 additions and 6 deletions

View file

@ -46,6 +46,11 @@ describe Upload do
end
it "extracts file extension" do
created_upload = UploadCreator.new(image, image_filename).create_for(user_id)
expect(created_upload.extension).to eq("png")
end
context ".get_from_url" do
let(:url) { "/uploads/default/original/3X/1/0/10f73034616a796dfd70177dc54b6def44c4ba6f.png" }
let(:upload) { Fabricate(:upload, url: url) }