mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 02:48:09 +08:00

This introduces a new model to store the avatars and 3 uploads per user (gravatar, system and custom) user can then pick which they want.
22 lines
456 B
Ruby
22 lines
456 B
Ruby
require 'spec_helper'
|
|
|
|
describe UserAvatar do
|
|
let(:avatar){
|
|
user = Fabricate(:user)
|
|
user.create_user_avatar!
|
|
}
|
|
|
|
it 'can generate a system avatar' do
|
|
avatar.update_system_avatar!
|
|
avatar.system_upload.should_not be_nil
|
|
end
|
|
|
|
it 'can update gravatars' do
|
|
temp = Tempfile.new('test')
|
|
FileHelper.expects(:download).returns(temp)
|
|
avatar.update_gravatar!
|
|
temp.unlink
|
|
avatar.gravatar_upload.should_not be_nil
|
|
end
|
|
end
|