2015-10-11 05:41:23 -04:00
|
|
|
require "rails_helper"
|
2014-02-24 22:30:49 -05:00
|
|
|
|
|
|
|
describe DiscourseSingleSignOn do
|
|
|
|
before do
|
|
|
|
@sso_url = "http://somesite.com/discourse_sso"
|
|
|
|
@sso_secret = "shjkfdhsfkjh"
|
|
|
|
|
2014-11-26 01:25:54 -05:00
|
|
|
SiteSetting.enable_sso = true
|
|
|
|
SiteSetting.sso_url = @sso_url
|
|
|
|
SiteSetting.sso_secret = @sso_secret
|
2014-02-24 22:30:49 -05:00
|
|
|
end
|
|
|
|
|
2014-03-19 17:14:09 -04:00
|
|
|
def make_sso
|
2014-02-24 22:30:49 -05:00
|
|
|
sso = SingleSignOn.new
|
|
|
|
sso.sso_url = "http://meta.discorse.org/topics/111"
|
|
|
|
sso.sso_secret = "supersecret"
|
|
|
|
sso.nonce = "testing"
|
|
|
|
sso.email = "some@email.com"
|
|
|
|
sso.username = "sam"
|
|
|
|
sso.name = "sam saffron"
|
|
|
|
sso.external_id = "100"
|
2016-08-28 21:28:19 -04:00
|
|
|
sso.avatar_url = "https://cdn.discourse.org/user_avatar.png"
|
|
|
|
sso.avatar_force_update = false
|
|
|
|
sso.bio = "about"
|
|
|
|
sso.admin = false
|
|
|
|
sso.moderator = false
|
|
|
|
sso.suppress_welcome_message = false
|
2015-05-21 09:41:36 -04:00
|
|
|
sso.require_activation = false
|
2017-01-31 19:42:27 -05:00
|
|
|
sso.title = "user title"
|
2014-04-21 23:52:13 -04:00
|
|
|
sso.custom_fields["a"] = "Aa"
|
|
|
|
sso.custom_fields["b.b"] = "B.b"
|
2014-03-19 17:14:09 -04:00
|
|
|
sso
|
|
|
|
end
|
2014-02-24 22:30:49 -05:00
|
|
|
|
2014-03-19 17:14:09 -04:00
|
|
|
def test_parsed(parsed, sso)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(parsed.nonce).to eq sso.nonce
|
|
|
|
expect(parsed.email).to eq sso.email
|
|
|
|
expect(parsed.username).to eq sso.username
|
|
|
|
expect(parsed.name).to eq sso.name
|
|
|
|
expect(parsed.external_id).to eq sso.external_id
|
2016-08-28 21:28:19 -04:00
|
|
|
expect(parsed.avatar_url).to eq sso.avatar_url
|
|
|
|
expect(parsed.avatar_force_update).to eq sso.avatar_force_update
|
|
|
|
expect(parsed.bio).to eq sso.bio
|
|
|
|
expect(parsed.admin).to eq sso.admin
|
|
|
|
expect(parsed.moderator).to eq sso.moderator
|
|
|
|
expect(parsed.suppress_welcome_message).to eq sso.suppress_welcome_message
|
2015-05-21 09:41:36 -04:00
|
|
|
expect(parsed.require_activation).to eq false
|
2017-01-31 19:42:27 -05:00
|
|
|
expect(parsed.title).to eq sso.title
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(parsed.custom_fields["a"]).to eq "Aa"
|
|
|
|
expect(parsed.custom_fields["b.b"]).to eq "B.b"
|
2014-03-19 17:14:09 -04:00
|
|
|
end
|
|
|
|
|
2014-12-28 21:30:54 -05:00
|
|
|
it "can do round trip parsing correctly" do
|
|
|
|
sso = SingleSignOn.new
|
|
|
|
sso.sso_secret = "test"
|
|
|
|
sso.name = "sam saffron"
|
|
|
|
sso.username = "sam"
|
|
|
|
sso.email = "sam@sam.com"
|
|
|
|
|
|
|
|
sso = SingleSignOn.parse(sso.payload, "test")
|
|
|
|
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(sso.name).to eq "sam saffron"
|
|
|
|
expect(sso.username).to eq "sam"
|
|
|
|
expect(sso.email).to eq "sam@sam.com"
|
2014-12-28 21:30:54 -05:00
|
|
|
end
|
|
|
|
|
2015-02-23 15:58:45 -05:00
|
|
|
let(:ip_address) { "127.0.0.1" }
|
|
|
|
|
2014-06-02 03:32:39 -04:00
|
|
|
it "can lookup or create user when name is blank" do
|
|
|
|
# so we can create system messages
|
|
|
|
Fabricate(:admin)
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "test"
|
|
|
|
sso.name = ""
|
|
|
|
sso.email = "test@test.com"
|
|
|
|
sso.external_id = "A"
|
2015-02-23 15:58:45 -05:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(user).to_not be_nil
|
2014-06-02 03:32:39 -04:00
|
|
|
end
|
2016-05-17 03:31:34 -04:00
|
|
|
|
2016-06-21 05:28:58 -04:00
|
|
|
it "unstaged users" do
|
|
|
|
email = "staged@user.com"
|
|
|
|
Fabricate(:user, staged: true, email: email)
|
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "staged"
|
|
|
|
sso.name = "Staged User"
|
|
|
|
sso.email = email
|
|
|
|
sso.external_id = "B"
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
|
|
|
|
expect(user).to_not be_nil
|
|
|
|
expect(user.staged).to be(false)
|
|
|
|
end
|
|
|
|
|
2016-05-17 03:31:34 -04:00
|
|
|
it "can set admin and moderator" do
|
|
|
|
admin_group = Group[:admins]
|
|
|
|
mod_group = Group[:moderators]
|
|
|
|
staff_group = Group[:staff]
|
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "misteradmin"
|
|
|
|
sso.name = "Bob Admin"
|
|
|
|
sso.email = "admin@admin.com"
|
|
|
|
sso.external_id = "id"
|
|
|
|
sso.admin = true
|
|
|
|
sso.moderator = true
|
|
|
|
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
staff_group.reload
|
|
|
|
|
|
|
|
expect(mod_group.users.where('users.id = ?', user.id).exists?).to eq(true)
|
|
|
|
expect(staff_group.users.where('users.id = ?', user.id).exists?).to eq(true)
|
|
|
|
expect(admin_group.users.where('users.id = ?', user.id).exists?).to eq(true)
|
|
|
|
end
|
2014-06-02 03:32:39 -04:00
|
|
|
|
2016-11-11 00:57:31 -05:00
|
|
|
it "can specify groups" do
|
|
|
|
|
|
|
|
user = Fabricate(:user)
|
|
|
|
|
|
|
|
add_group1 = Fabricate(:group, name: 'group1')
|
|
|
|
add_group2 = Fabricate(:group, name: 'group2')
|
|
|
|
existing_group = Fabricate(:group, name: 'group3')
|
|
|
|
|
|
|
|
existing_group.add(user)
|
|
|
|
existing_group.save!
|
|
|
|
|
|
|
|
add_group1.add(user)
|
|
|
|
existing_group.save!
|
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "bobsky"
|
|
|
|
sso.name = "Bob"
|
|
|
|
sso.email = user.email
|
|
|
|
sso.external_id = "A"
|
|
|
|
|
|
|
|
sso.add_groups = "#{add_group1.name},#{add_group2.name},badname"
|
|
|
|
sso.remove_groups = "#{existing_group.name},badname"
|
|
|
|
|
|
|
|
sso.lookup_or_create_user(ip_address)
|
|
|
|
|
|
|
|
existing_group.reload
|
|
|
|
expect(existing_group.usernames).to eq("")
|
|
|
|
|
|
|
|
add_group1.reload
|
|
|
|
expect(add_group1.usernames).to eq(user.username)
|
|
|
|
|
|
|
|
add_group2.reload
|
|
|
|
expect(add_group2.usernames).to eq(user.username)
|
|
|
|
end
|
|
|
|
|
2015-03-26 18:39:35 -04:00
|
|
|
it "can override name / email / username" do
|
|
|
|
admin = Fabricate(:admin)
|
|
|
|
|
|
|
|
SiteSetting.sso_overrides_name = true
|
|
|
|
SiteSetting.sso_overrides_email = true
|
|
|
|
SiteSetting.sso_overrides_username = true
|
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "bob%the$admin"
|
|
|
|
sso.name = "Bob Admin"
|
|
|
|
sso.email = admin.email
|
|
|
|
sso.external_id = "A"
|
|
|
|
|
|
|
|
sso.lookup_or_create_user(ip_address)
|
|
|
|
|
|
|
|
admin.reload
|
|
|
|
|
|
|
|
expect(admin.name).to eq "Bob Admin"
|
|
|
|
expect(admin.username).to eq "bob_the_admin"
|
|
|
|
expect(admin.email).to eq admin.email
|
|
|
|
|
|
|
|
sso.email = "TEST@bob.com"
|
|
|
|
|
2015-03-26 19:25:32 -04:00
|
|
|
sso.name = "Louis C.K."
|
|
|
|
|
2015-03-26 18:39:35 -04:00
|
|
|
sso.lookup_or_create_user(ip_address)
|
|
|
|
|
|
|
|
admin.reload
|
2015-03-26 19:04:16 -04:00
|
|
|
|
2015-03-26 18:39:35 -04:00
|
|
|
expect(admin.email).to eq("test@bob.com")
|
2015-03-26 19:04:16 -04:00
|
|
|
expect(admin.username).to eq "bob_the_admin"
|
2015-03-26 19:25:32 -04:00
|
|
|
expect(admin.name).to eq "Louis C.K."
|
2015-03-26 18:39:35 -04:00
|
|
|
end
|
|
|
|
|
2014-03-19 17:14:09 -04:00
|
|
|
it "can fill in data on way back" do
|
|
|
|
sso = make_sso
|
|
|
|
|
|
|
|
url, payload = sso.to_url.split("?")
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(url).to eq sso.sso_url
|
2014-03-19 17:14:09 -04:00
|
|
|
parsed = SingleSignOn.parse(payload, "supersecret")
|
|
|
|
|
|
|
|
test_parsed(parsed, sso)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "handles sso_url with query params" do
|
|
|
|
sso = make_sso
|
|
|
|
sso.sso_url = "http://tcdev7.wpengine.com/?action=showlogin"
|
|
|
|
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(sso.to_url.split('?').size).to eq 2
|
2014-03-19 17:14:09 -04:00
|
|
|
|
|
|
|
url, payload = sso.to_url.split("?")
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(url).to eq "http://tcdev7.wpengine.com/"
|
2014-03-19 17:14:09 -04:00
|
|
|
parsed = SingleSignOn.parse(payload, "supersecret")
|
2014-02-24 22:30:49 -05:00
|
|
|
|
2014-03-19 17:14:09 -04:00
|
|
|
test_parsed(parsed, sso)
|
2014-02-24 22:30:49 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "validates nonce" do
|
|
|
|
_ , payload = DiscourseSingleSignOn.generate_url.split("?")
|
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.parse(payload)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(sso.nonce_valid?).to eq true
|
2014-02-24 22:30:49 -05:00
|
|
|
|
|
|
|
sso.expire_nonce!
|
|
|
|
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(sso.nonce_valid?).to eq false
|
2014-02-24 22:30:49 -05:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
it "generates a correct sso url" do
|
|
|
|
url, payload = DiscourseSingleSignOn.generate_url.split("?")
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(url).to eq @sso_url
|
2014-02-24 22:30:49 -05:00
|
|
|
|
|
|
|
sso = DiscourseSingleSignOn.parse(payload)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(sso.nonce).to_not be_nil
|
2014-02-24 22:30:49 -05:00
|
|
|
end
|
2015-01-28 10:47:59 -05:00
|
|
|
|
2015-05-15 13:00:34 -04:00
|
|
|
context 'trusting emails' do
|
|
|
|
let(:sso) {
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "test"
|
|
|
|
sso.name = "test"
|
|
|
|
sso.email = "test@example.com"
|
|
|
|
sso.external_id = "A"
|
|
|
|
sso
|
|
|
|
}
|
|
|
|
|
|
|
|
it 'activates users by default' do
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.active).to eq(true)
|
|
|
|
end
|
|
|
|
|
2015-05-19 12:16:02 -04:00
|
|
|
it 'does not activate user when asked not to' do
|
|
|
|
sso.require_activation = true
|
2015-05-15 13:00:34 -04:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.active).to eq(false)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2015-03-20 13:03:24 -04:00
|
|
|
context 'welcome emails' do
|
|
|
|
let(:sso) {
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "test"
|
|
|
|
sso.name = "test"
|
|
|
|
sso.email = "test@example.com"
|
|
|
|
sso.external_id = "A"
|
|
|
|
sso
|
|
|
|
}
|
|
|
|
|
|
|
|
it "sends a welcome email by default" do
|
|
|
|
User.any_instance.expects(:enqueue_welcome_message).once
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "suppresses the welcome email when asked to" do
|
|
|
|
User.any_instance.expects(:enqueue_welcome_message).never
|
|
|
|
sso.suppress_welcome_message = true
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-31 19:42:27 -05:00
|
|
|
context 'setting title for a user' do
|
|
|
|
let(:sso) {
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = 'test'
|
|
|
|
sso.name = 'test'
|
|
|
|
sso.email = 'test@test.com'
|
|
|
|
sso.external_id = '100'
|
|
|
|
sso.title = "The User's Title"
|
|
|
|
sso
|
|
|
|
}
|
|
|
|
|
2017-02-07 10:41:27 -05:00
|
|
|
it 'sets title correctly' do
|
2017-01-31 19:42:27 -05:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.title).to eq(sso.title)
|
|
|
|
|
2017-02-07 10:41:27 -05:00
|
|
|
sso.title = "farmer"
|
2017-01-31 19:42:27 -05:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
|
2017-02-07 10:41:27 -05:00
|
|
|
expect(user.title).to eq("farmer")
|
|
|
|
|
|
|
|
sso.title = nil
|
2017-01-31 19:42:27 -05:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
|
2017-02-07 10:41:27 -05:00
|
|
|
expect(user.title).to eq("farmer")
|
2017-01-31 19:42:27 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-01 01:29:28 -04:00
|
|
|
context 'setting bio for a user' do
|
|
|
|
let(:sso) {
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "test"
|
|
|
|
sso.name = "test"
|
|
|
|
sso.email = "test@test.com"
|
|
|
|
sso.external_id = "100"
|
|
|
|
sso.bio = "This **is** the bio"
|
|
|
|
sso
|
|
|
|
}
|
|
|
|
|
|
|
|
it 'can set bio if supplied on new users or users with empty bio' do
|
|
|
|
# new account
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.user_profile.bio_cooked).to match_html("<p>This <strong>is</strong> the bio</p>")
|
|
|
|
|
|
|
|
|
|
|
|
# no override by default
|
|
|
|
sso.bio = "new profile"
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
|
|
|
|
expect(user.user_profile.bio_cooked).to match_html("<p>This <strong>is</strong> the bio</p>")
|
|
|
|
|
|
|
|
# yes override for blank
|
|
|
|
user.user_profile.bio_raw = " "
|
|
|
|
user.user_profile.save!
|
|
|
|
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.user_profile.bio_cooked).to match_html("<p>new profile</p>")
|
|
|
|
|
|
|
|
|
|
|
|
# yes override if site setting
|
|
|
|
sso.bio = "new profile 2"
|
|
|
|
SiteSetting.sso_overrides_bio = true
|
|
|
|
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
expect(user.user_profile.bio_cooked).to match_html("<p>new profile 2</p>")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2016-09-01 22:04:22 -04:00
|
|
|
context 'when sso_overrides_avatar is not enabled' do
|
|
|
|
|
|
|
|
|
|
|
|
it "correctly handles provided avatar_urls" do
|
2016-10-24 13:55:30 -04:00
|
|
|
Sidekiq::Testing.inline! do
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.external_id = 666
|
|
|
|
sso.email = "sam@sam.com"
|
|
|
|
sso.name = "sam"
|
|
|
|
sso.username = "sam"
|
|
|
|
sso.avatar_url = "http://awesome.com/image.png"
|
|
|
|
|
|
|
|
FileHelper.stubs(:download).returns(file_from_fixtures("logo.png"))
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
user.reload
|
|
|
|
avatar_id = user.uploaded_avatar_id
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
user.reload
|
|
|
|
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)
|
|
|
|
user.reload
|
|
|
|
|
|
|
|
# avatar updated but no override specified ...
|
|
|
|
expect(user.uploaded_avatar_id).to eq(avatar_id)
|
|
|
|
|
|
|
|
sso.avatar_force_update = true
|
|
|
|
FileHelper.stubs(:download).returns(file_from_fixtures("logo-dev.png"))
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
user.reload
|
|
|
|
|
|
|
|
# we better have a new avatar
|
|
|
|
expect(user.uploaded_avatar_id).not_to eq(avatar_id)
|
|
|
|
expect(user.uploaded_avatar_id).not_to eq(nil)
|
|
|
|
|
|
|
|
avatar_id = user.uploaded_avatar_id
|
|
|
|
|
|
|
|
sso.avatar_force_update = true
|
|
|
|
FileHelper.stubs(:download) { raise "not found" }
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
user.reload
|
|
|
|
|
|
|
|
# we better have the same avatar
|
|
|
|
expect(user.uploaded_avatar_id).to eq(avatar_id)
|
|
|
|
end
|
2016-09-01 22:04:22 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2015-01-28 10:47:59 -05:00
|
|
|
context 'when sso_overrides_avatar is enabled' do
|
2015-01-28 11:52:07 -05:00
|
|
|
let!(:sso_record) { Fabricate(:single_sign_on_record, external_avatar_url: "http://example.com/an_image.png") }
|
2016-10-24 13:55:30 -04:00
|
|
|
|
2015-01-28 11:52:07 -05:00
|
|
|
let!(:sso) {
|
|
|
|
sso = DiscourseSingleSignOn.new
|
|
|
|
sso.username = "test"
|
|
|
|
sso.name = "test"
|
|
|
|
sso.email = sso_record.user.email
|
|
|
|
sso.external_id = sso_record.external_id
|
|
|
|
sso
|
|
|
|
}
|
2016-10-24 13:55:30 -04:00
|
|
|
|
2015-01-28 11:52:07 -05:00
|
|
|
let(:logo) { file_from_fixtures("logo.png") }
|
2015-01-28 10:47:59 -05:00
|
|
|
|
|
|
|
before do
|
|
|
|
SiteSetting.sso_overrides_avatar = true
|
|
|
|
end
|
|
|
|
|
|
|
|
it "deal with no avatar url passed for an existing user with an avatar" do
|
2016-10-24 13:55:30 -04:00
|
|
|
Sidekiq::Testing.inline! do
|
|
|
|
# Deliberately not setting avatar_url so it should not update
|
|
|
|
sso_record.user.update_columns(uploaded_avatar_id: -1)
|
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
user.reload
|
|
|
|
|
|
|
|
expect(user).to_not be_nil
|
|
|
|
expect(user.uploaded_avatar_id).to eq(-1)
|
|
|
|
end
|
2015-01-28 10:47:59 -05:00
|
|
|
end
|
2015-01-28 11:52:07 -05:00
|
|
|
|
|
|
|
it "deal with no avatar_force_update passed as a boolean" do
|
2016-10-24 13:55:30 -04:00
|
|
|
Sidekiq::Testing.inline! do
|
|
|
|
FileHelper.stubs(:download).returns(logo)
|
2015-01-28 11:52:07 -05:00
|
|
|
|
2016-10-24 13:55:30 -04:00
|
|
|
sso_record.user.update_columns(uploaded_avatar_id: -1)
|
2016-09-01 22:04:22 -04:00
|
|
|
|
2016-10-24 13:55:30 -04:00
|
|
|
sso.avatar_url = "http://example.com/a_different_image.png"
|
|
|
|
sso.avatar_force_update = false
|
2015-01-28 11:52:07 -05:00
|
|
|
|
2016-10-24 13:55:30 -04:00
|
|
|
user = sso.lookup_or_create_user(ip_address)
|
|
|
|
user.reload
|
2016-09-01 22:04:22 -04:00
|
|
|
|
2016-10-24 13:55:30 -04:00
|
|
|
expect(user).to_not be_nil
|
|
|
|
expect(user.uploaded_avatar_id).to_not eq(-1)
|
|
|
|
end
|
2015-01-28 11:52:07 -05:00
|
|
|
end
|
2015-01-28 10:47:59 -05:00
|
|
|
end
|
2014-02-24 22:30:49 -05:00
|
|
|
end
|