Spec Notify mailers
Created by: robbkidd
Add spec for Notify ActionMailer class and update mailer methods to be queue-friendly.
The MailerObserver class is the only consumer of Notify and remains unspec'd. I started in on specs for it, but they got hairy quickly because MailerObserver knows about lots of things and has a fair amount of branching logic. Absent these specs for the moment, I did my best to update the calls to the Notify methods to use IDs as parameters.
With the number of changes already in this branch, I reckon it would be good to submit it for review even if you find that it is not ready to merge.
Related to code and commentary in pull requests #813 and #820
Merge request reports
Activity
20 21 mail(:to => @user.email, :subject => "gitlab | New Issue was created") 16 def new_issue_email(issue_id) 17 @issue = Issue.find(issue_id) 18 mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created") 22 19 end 23 20 24 def note_wall_email(user, note) 25 @user = user 26 @note = Note.find(note['id']) 27 @project = @note.project 28 mail(:to => @user['email'], :subject => "gitlab | #{@note.project.name} ") 21 def note_wall_email(recipient_id, note_id) 22 recipient = User.find(recipient_id) 23 @note = Note.find(note_id) 24 mail(:to => recipient.email, :subject => "gitlab | #{@note.project_name} ") 20 21 mail(:to => @user.email, :subject => "gitlab | New Issue was created") 16 def new_issue_email(issue_id) 17 @issue = Issue.find(issue_id) 18 mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created") 22 19 end 23 20 24 def note_wall_email(user, note) 25 @user = user 26 @note = Note.find(note['id']) 27 @project = @note.project 28 mail(:to => @user['email'], :subject => "gitlab | #{@note.project.name} ") 21 def note_wall_email(recipient_id, note_id) 22 recipient = User.find(recipient_id) 23 @note = Note.find(note_id) 24 mail(:to => recipient.email, :subject => "gitlab | #{@note.project_name} ") Created by: dzaporozhets
http://travis-ci.org/#!/gitlabhq/gitlabhq/builds/1343164 8 Failed tests
By Administrator on 2012-05-16T06:56:34 (imported from GitLab project)
By Administrator on 2012-05-16T06:56:34 (imported from GitLab)
Created by: robbkidd
Curses! I set the domain for the mailers to be "example.com" but on Travis it is "gitlabhq.com". I'll get that fixed.
Update: I see what I did. I made my own config/gitlab.yml and was using "example.com" for my host. That's why the specs were green in my dev environment.
By Administrator on 2012-05-16T14:18:11 (imported from GitLab project)
By Administrator on 2012-05-16T14:18:11 (imported from GitLab)