discourse/spec/models/user_avatar_spec.rb
Sam 6c1c8be794 Work in progress, keeping avatars locally
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.
2014-05-27 10:08:03 +10:00

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