mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Correct short url decoding for sha1s leading with zero
This was picked up cause we had a flaky test!
This commit is contained in:
parent
c7532003f3
commit
f766ea4257
2 changed files with 11 additions and 1 deletions
|
@ -128,6 +128,11 @@ describe Upload do
|
|||
expect(Upload.sha1_from_short_url('upload://r3AYqESanERjladb4vBB7VsMBm6')).to eq(sha1)
|
||||
expect(Upload.sha1_from_short_url('r3AYqESanERjladb4vBB7VsMBm6')).to eq(sha1)
|
||||
end
|
||||
|
||||
it "should be able to look up sha1 even with leading zeros" do
|
||||
sha1 = '0000c513e1da04f7b4e99230851ea2aafeb8cc4e'
|
||||
expect(Upload.sha1_from_short_url('upload://1Eg9p8rrCURq4T3a6iJUk0ri6.png')).to eq(sha1)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue