mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: cleanup old letter avatars if needed
FEATURE: use image magick version as a key for letter avatars
This commit is contained in:
15
spec/components/letter_avatar_spec.rb
Normal file
15
spec/components/letter_avatar_spec.rb
Normal file
@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
require 'letter_avatar'
|
||||
|
||||
describe LetterAvatar do
|
||||
it "can cleanup correctly" do
|
||||
path = LetterAvatar.cache_path
|
||||
|
||||
FileUtils.mkdir_p(path + "junk")
|
||||
LetterAvatar.generate("test", 100)
|
||||
|
||||
LetterAvatar.cleanup_old
|
||||
|
||||
Dir.entries(File.dirname(path)).length.should == 3
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user