Commit da6b53a8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'omniauth_no_email_1' of https://github.com/gliptak/gitlabhq into...

Merge branch 'omniauth_no_email_1' of https://github.com/gliptak/gitlabhq into gliptak-omniauth_no_email_1

Conflicts:
	app/observers/user_observer.rb
	spec/observers/user_observer_spec.rb
parents d5d9f1c5 cb2be3ce
...@@ -2,7 +2,8 @@ class UserObserver < ActiveRecord::Observer ...@@ -2,7 +2,8 @@ class UserObserver < ActiveRecord::Observer
def after_create(user) def after_create(user)
log_info("User \"#{user.name}\" (#{user.email}) was created") log_info("User \"#{user.name}\" (#{user.email}) was created")
Notify.delay.new_user_email(user.id, user.password) # Dont email omniauth created users
Notify.delay.new_user_email(user.id, user.password) unless user.extern_uid?
end end
def after_destroy user def after_destroy user
......
...@@ -15,7 +15,13 @@ describe UserObserver do ...@@ -15,7 +15,13 @@ describe UserObserver do
create(:user) create(:user)
end end
it 'no email for external' do
Notify.should_receive(:new_user_email)
create(:user, extern_uid: '32442eEfsafada')
end
it 'trigger logger' do it 'trigger logger' do
user = double(:user, id: 42, password: 'P@ssword!', name: 'John', email: 'u@mail.local', extern_uid?: false)
Gitlab::AppLogger.should_receive(:info) Gitlab::AppLogger.should_receive(:info)
create(:user) create(:user)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment