Commit 0ceb4036c5fa8c32f4b36b2486827401ddcc3156
1 parent
d948f581
Exists in
master
and in
22 other branches
rails3: fix mailer deliver
Showing
3 changed files
with
7 additions
and
7 deletions
Show diff stats
test/unit/create_community_test.rb
| ... | ... | @@ -98,7 +98,7 @@ class CreateCommunityTest < ActiveSupport::TestCase |
| 98 | 98 | should 'deliver target notification message' do |
| 99 | 99 | task = CreateCommunity.new(:name => 'community test', :target => Environment.default, :requestor => person) |
| 100 | 100 | |
| 101 | - email = TaskMailer.deliver_target_notification(task, task.target_notification_message) | |
| 101 | + email = TaskMailer.target_notification(task, task.target_notification_message).deliver | |
| 102 | 102 | assert_match(/#{task.requestor.name} wants to create community #{task.subject}/, email.subject) |
| 103 | 103 | end |
| 104 | 104 | ... | ... |
test/unit/invite_member_test.rb
| ... | ... | @@ -88,10 +88,10 @@ class InviteMemberTest < ActiveSupport::TestCase |
| 88 | 88 | should 'not invite yourself' do |
| 89 | 89 | p = create_user('testuser1').person |
| 90 | 90 | |
| 91 | - task1 = InviteMember.new(:person => p, :friend => p, :message => 'click here: <url>') | |
| 91 | + task1 = build(InviteMember, :person => p, :friend => p, :message => 'click here: <url>') | |
| 92 | 92 | assert !task1.save |
| 93 | 93 | |
| 94 | - task2 = InviteMember.new(:person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') | |
| 94 | + task2 = build(InviteMember, :person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') | |
| 95 | 95 | assert !task2.save |
| 96 | 96 | end |
| 97 | 97 | |
| ... | ... | @@ -99,7 +99,7 @@ class InviteMemberTest < ActiveSupport::TestCase |
| 99 | 99 | p = create_user('testuser1').person |
| 100 | 100 | community = fast_create(Community) |
| 101 | 101 | |
| 102 | - task = InviteMember.create!(:person => p, :friend_email => 'test@test.com', :message => '<url>', :community_id => community.id) | |
| 102 | + task = create(InviteMember, :person => p, :friend_email => 'test@test.com', :message => '<url>', :community_id => community.id) | |
| 103 | 103 | |
| 104 | 104 | assert_match(/#{task.requestor.name} invited you to join #{community.name}/, task.target_notification_description) |
| 105 | 105 | end |
| ... | ... | @@ -108,9 +108,9 @@ class InviteMemberTest < ActiveSupport::TestCase |
| 108 | 108 | person = create_user('testuser1').person |
| 109 | 109 | community = fast_create(Community) |
| 110 | 110 | |
| 111 | - task = InviteMember.create!(:person => person, :friend_email => 'test@test.com', :message => '<url>', :community_id => community.id) | |
| 111 | + task = create(InviteMember, :person => person, :friend_email => 'test@test.com', :message => '<url>', :community_id => community.id) | |
| 112 | 112 | |
| 113 | - email = TaskMailer.deliver_invitation_notification(task) | |
| 113 | + email = TaskMailer.invitation_notification(task).deliver | |
| 114 | 114 | |
| 115 | 115 | assert_match(/#{task.requestor.name} invited you to join #{community.name}/, email.subject) |
| 116 | 116 | end | ... | ... |
test/unit/suggest_article_test.rb
| ... | ... | @@ -145,7 +145,7 @@ class SuggestArticleTest < ActiveSupport::TestCase |
| 145 | 145 | should 'deliver target notification message' do |
| 146 | 146 | task = build(SuggestArticle, :target => @profile, :article_name => 'suggested article', :name => 'johndoe', :email => 'johndoe@example.com') |
| 147 | 147 | |
| 148 | - email = TaskMailer.deliver_target_notification(task, task.target_notification_message) | |
| 148 | + email = TaskMailer.target_notification(task, task.target_notification_message).deliver | |
| 149 | 149 | |
| 150 | 150 | assert_match(/#{task.name}.*suggested the publication of the article: #{task.subject}/, email.subject) |
| 151 | 151 | end | ... | ... |