Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
3d45d300
Commit
3d45d300
authored
Mar 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gliptak-omniauth_no_email_1'
parents
d5d9f1c5
2d2a235c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/observers/user_observer.rb
app/observers/user_observer.rb
+2
-1
spec/observers/user_observer_spec.rb
spec/observers/user_observer_spec.rb
+6
-0
No files found.
app/observers/user_observer.rb
View file @
3d45d300
...
...
@@ -2,7 +2,8 @@ class UserObserver < ActiveRecord::Observer
def
after_create
(
user
)
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
def
after_destroy
user
...
...
spec/observers/user_observer_spec.rb
View file @
3d45d300
...
...
@@ -15,7 +15,13 @@ describe UserObserver do
create
(
:user
)
end
it
'no email for external'
do
Notify
.
should_not_receive
(
:new_user_email
)
create
(
:user
,
extern_uid:
'32442eEfsafada'
)
end
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
)
create
(
:user
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment