FIX: Upload#short_url generates incorrect URL when extension is nil.

This commit is contained in:
Guo Xiang Tan
2019-06-19 09:10:50 +08:00
parent e8b9f38374
commit 73a45048a0
4 changed files with 9 additions and 3 deletions

View File

@ -235,6 +235,9 @@ describe Upload do
it "should generate a correct short url" do
upload = Upload.new(sha1: 'bda2c513e1da04f7b4e99230851ea2aafeb8cc4e', extension: 'png')
expect(upload.short_url).to eq('upload://r3AYqESanERjladb4vBB7VsMBm6.png')
upload.extension = nil
expect(upload.short_url).to eq('upload://r3AYqESanERjladb4vBB7VsMBm6')
end
end