diff options
author | Robb Kidd <robb@thekidds.org> | 2012-05-15 18:48:00 -0400 |
---|---|---|
committer | Robb Kidd <robb@thekidds.org> | 2012-05-15 22:37:33 -0400 |
commit | bb22360d1a7548facff3b72b2f9a0e66c6a55bb7 (patch) | |
tree | b32bea574bca56ff2b4ba8beea598376a6c26ce9 /spec/mailers | |
parent | 5fe75649b3e278562b241abadb7d5a62146cff34 (diff) | |
download | gitlab-ce-bb22360d1a7548facff3b72b2f9a0e66c6a55bb7.tar.gz |
Make Notify#note_merge_request_email resque friendly
Update method to take ids and then perform #finds itself during mailer
queue worker kick-off.
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 7211f121239..052840967eb 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -153,6 +153,10 @@ describe Notify do let(:note_author) { Factory.create(:user, :name => 'author_name') } let(:note) { Factory.create(:note, :project => project, :author => note_author) } + before :each do + Note.stub(:find).with(note.id).and_return(note) + end + shared_examples 'a note email' do it 'is sent to the given recipient' do should deliver_to recipient.email @@ -191,7 +195,7 @@ describe Notify do end before(:each) { note.stub(:target).and_return(commit) } - subject { Notify.note_commit_email(recipient, note) } + subject { Notify.note_commit_email(recipient.id, note.id) } it_behaves_like 'a note email' @@ -209,7 +213,7 @@ describe Notify do let(:note_on_merge_request_url) { project_merge_request_url(project, merge_request, :anchor => "note_#{note.id}") } before(:each) { note.stub(:noteable).and_return(merge_request) } - subject { Notify.note_merge_request_email(recipient, note) } + subject { Notify.note_merge_request_email(recipient.id, note.id) } it_behaves_like 'a note email' |