##// END OF EJS Templates
Renamed Mailer#test to Mailer#test_email....
Jean-Philippe Lang -
r8960:d862843c9d58
parent child
Show More
@@ -63,7 +63,7 class AdminController < ApplicationController
63 63 # Force ActionMailer to raise delivery errors so we can catch it
64 64 ActionMailer::Base.raise_delivery_errors = true
65 65 begin
66 @test = Mailer.deliver_test(User.current)
66 @test = Mailer.deliver_test_email(User.current)
67 67 flash[:notice] = l(:notice_email_sent, User.current.mail)
68 68 rescue Exception => e
69 69 flash[:error] = l(:notice_email_error, e.message)
@@ -290,12 +290,12 class Mailer < ActionMailer::Base
290 290 render_multipart('register', body)
291 291 end
292 292
293 def test(user)
293 def test_email(user)
294 294 set_language_if_valid(user.language)
295 295 recipients user.mail
296 296 subject 'Redmine test'
297 297 body :url => url_for(:controller => 'welcome')
298 render_multipart('test', body)
298 render_multipart('test_email', body)
299 299 end
300 300
301 301 # Overrides default deliver! method to prevent from sending an email
1 NO CONTENT: file renamed from app/views/mailer/test.html.erb to app/views/mailer/test_email.html.erb
1 NO CONTENT: file renamed from app/views/mailer/test.text.erb to app/views/mailer/test_email.text.erb
@@ -176,7 +176,7 END_DESC
176 176
177 177 ActionMailer::Base.raise_delivery_errors = true
178 178 begin
179 Mailer.deliver_test(User.current)
179 Mailer.deliver_test_email(User.current)
180 180 puts l(:notice_email_sent, user.mail)
181 181 rescue Exception => e
182 182 abort l(:notice_email_error, e.message)
@@ -91,7 +91,7 class AdminControllerTest < ActionController::TestCase
91 91 end
92 92
93 93 def test_test_email_failure_should_display_the_error
94 Mailer.stubs(:deliver_test).raises(Exception, 'Some error message')
94 Mailer.stubs(:deliver_test_email).raises(Exception, 'Some error message')
95 95 get :test_email
96 96 assert_redirected_to '/settings/edit?tab=notifications'
97 97 assert_match /Some error message/, flash[:error]
@@ -196,7 +196,7 class MailerTest < ActiveSupport::TestCase
196 196
197 197 def test_from_header
198 198 with_settings :mail_from => 'redmine@example.net' do
199 Mailer.deliver_test(User.find(1))
199 Mailer.deliver_test_email(User.find(1))
200 200 end
201 201 mail = last_email
202 202 assert_equal 'redmine@example.net', mail.from_addrs.first.address
@@ -204,7 +204,7 class MailerTest < ActiveSupport::TestCase
204 204
205 205 def test_from_header_with_phrase
206 206 with_settings :mail_from => 'Redmine app <redmine@example.net>' do
207 Mailer.deliver_test(User.find(1))
207 Mailer.deliver_test_email(User.find(1))
208 208 end
209 209 mail = last_email
210 210 assert_equal 'redmine@example.net', mail.from_addrs.first.address
@@ -461,7 +461,7 class MailerTest < ActiveSupport::TestCase
461 461 user = User.find(1)
462 462 valid_languages.each do |lang|
463 463 user.update_attribute :language, lang.to_s
464 assert Mailer.deliver_test(user)
464 assert Mailer.deliver_test_email(user)
465 465 end
466 466 end
467 467
@@ -522,7 +522,7 class MailerTest < ActiveSupport::TestCase
522 522
523 523 def test_with_deliveries_off
524 524 Mailer.with_deliveries false do
525 Mailer.deliver_test(User.find(1))
525 Mailer.deliver_test_email(User.find(1))
526 526 end
527 527 assert ActionMailer::Base.deliveries.empty?
528 528 # should restore perform_deliveries
@@ -539,7 +539,7 class MailerTest < ActiveSupport::TestCase
539 539
540 540 def test_layout_should_include_the_emails_header
541 541 with_settings :emails_header => "*Header content*" do
542 assert Mailer.deliver_test(User.find(1))
542 assert Mailer.deliver_test_email(User.find(1))
543 543 assert_select_email do
544 544 assert_select ".header" do
545 545 assert_select "strong", :text => "Header content"
General Comments 0
You need to be logged in to leave comments. Login now