Skip to content
Snippets Groups Projects

Spec Notify mailers

Merged gitlab-qa-bot requested to merge github/fork/robbkidd/test_the_mailers into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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: oreofish

    @note.project_name is not defined in these codes.

    By Administrator on 2012-05-16T05:58:47 (imported from GitLab project)

    By Administrator on 2012-05-16T05:58:47 (imported from GitLab)

  • gitlab-qa-bot
  • 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: oreofish

      I found it. Please ignore my comment here. Sorry.

      By Administrator on 2012-05-16T06:09:31 (imported from GitLab project)

      By Administrator on 2012-05-16T06:09:31 (imported from GitLab)

  • Created by: oreofish

    I reviewd these commits. They are good for me.

    By Administrator on 2012-05-16T06:10:28 (imported from GitLab project)

    By Administrator on 2012-05-16T06:10:28 (imported from GitLab)

  • Created by: dzaporozhets

    @robbkidd great work! Code seems ok. I'm going to merge it

    By Administrator on 2012-05-16T06:36:06 (imported from GitLab project)

    By Administrator on 2012-05-16T06:36:06 (imported from GitLab)

  • 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)

  • Please register or sign in to reply
    Loading