FIX: always import avatars during SSO if they are missing

This commit is contained in:
Sam
2016-09-16 09:44:45 +10:00
parent b9801d2e26
commit 33578a2c17
2 changed files with 18 additions and 3 deletions

View File

@ -294,6 +294,16 @@ describe DiscourseSingleSignOn do
# initial creation ...
expect(avatar_id).to_not eq(nil)
# junk avatar id should be updated
old_id = user.uploaded_avatar_id
Upload.destroy(old_id)
user = sso.lookup_or_create_user(ip_address)
avatar_id = user.uploaded_avatar_id
expect(avatar_id).to_not eq(nil)
expect(old_id).to_not eq(avatar_id)
FileHelper.stubs(:download) { raise "should not be called" }
sso.avatar_url = "https://some.new/avatar.png"
user = sso.lookup_or_create_user(ip_address)