discourse/spec/models/user_avatar_spec.rb
Sam fa6f22dd39 Move letter avatars out of upload system
FIX: S3 issues around system avatars
FIX: reduced backup file size
2014-05-30 14:45:55 +10:00

20 lines
540 B
Ruby

require 'spec_helper'
describe UserAvatar do
let(:avatar){
user = Fabricate(:user)
user.create_user_avatar!
}
it 'can update gravatars' do
temp = Tempfile.new('test')
temp.binmode
# tiny valid png
temp.write(Base64.decode64("R0lGODlhAQABALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD//wBiZCH5BAEAAA8ALAAAAAABAAEAAAQC8EUAOw=="))
temp.rewind
FileHelper.expects(:download).returns(temp)
avatar.update_gravatar!
temp.unlink
avatar.gravatar_upload.should_not be_nil
end
end