mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
6c1c8be794
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.
21 lines
456 B
Ruby
21 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
|