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
Jérome Perrin
gitlab-ce
Commits
345f176a
Commit
345f176a
authored
May 14, 2012
by
Robb Kidd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update new_user_email to take id for User and perform find itself.
parent
06b45acb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/mailers/notify.rb
app/mailers/notify.rb
+3
-3
app/models/mailer_observer.rb
app/models/mailer_observer.rb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+2
-2
No files found.
app/mailers/notify.rb
View file @
345f176a
...
@@ -7,10 +7,10 @@ class Notify < ActionMailer::Base
...
@@ -7,10 +7,10 @@ class Notify < ActionMailer::Base
default
from:
EMAIL_OPTS
[
"from"
]
default
from:
EMAIL_OPTS
[
"from"
]
def
new_user_email
(
user
,
password
)
def
new_user_email
(
user
_id
,
password
)
@user
=
user
@user
=
User
.
find
(
user_id
)
@password
=
password
@password
=
password
mail
(
:to
=>
@user
[
'email'
]
,
:subject
=>
"gitlab | Account was created for you"
)
mail
(
:to
=>
@user
.
email
,
:subject
=>
"gitlab | Account was created for you"
)
end
end
def
new_issue_email
(
issue
)
def
new_issue_email
(
issue
)
...
...
app/models/mailer_observer.rb
View file @
345f176a
...
@@ -23,7 +23,7 @@ class MailerObserver < ActiveRecord::Observer
...
@@ -23,7 +23,7 @@ class MailerObserver < ActiveRecord::Observer
end
end
def
new_user
(
user
)
def
new_user
(
user
)
Notify
.
new_user_email
(
user
,
user
.
password
).
deliver
Notify
.
new_user_email
(
user
.
id
,
user
.
password
).
deliver
end
end
def
new_note
(
note
)
def
new_note
(
note
)
...
...
spec/mailers/notify_spec.rb
View file @
345f176a
...
@@ -19,9 +19,9 @@ describe Notify do
...
@@ -19,9 +19,9 @@ describe Notify do
describe
'for new users, the email'
do
describe
'for new users, the email'
do
let
(
:example_site_url
)
{
root_url
}
let
(
:example_site_url
)
{
root_url
}
let
(
:new_user
)
{
Factory
.
new
(
:user
,
:email
=>
'newguy@example.com'
,
:password
=>
'new_password
'
)
}
let
(
:new_user
)
{
Factory
.
create
(
:user
,
:email
=>
'newguy@example.com
'
)
}
subject
{
Notify
.
new_user_email
(
new_user
,
new_user
.
password
)
}
subject
{
Notify
.
new_user_email
(
new_user
.
id
,
new_user
.
password
)
}
it
'is sent to the new user'
do
it
'is sent to the new user'
do
should
deliver_to
new_user
.
email
should
deliver_to
new_user
.
email
...
...
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