summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_controller.rb2
-rw-r--r--app/models/mailer.rb4
-rw-r--r--app/views/mailer/test_email.html.erb (renamed from app/views/mailer/test.html.erb)0
-rw-r--r--app/views/mailer/test_email.text.erb (renamed from app/views/mailer/test.text.erb)0
-rw-r--r--lib/tasks/email.rake2
-rw-r--r--test/functional/admin_controller_test.rb2
-rw-r--r--test/unit/mailer_test.rb10
7 files changed, 10 insertions, 10 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index dd3e91236..9684f5cbf 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -63,7 +63,7 @@ class AdminController < ApplicationController
# Force ActionMailer to raise delivery errors so we can catch it
ActionMailer::Base.raise_delivery_errors = true
begin
- @test = Mailer.deliver_test(User.current)
+ @test = Mailer.deliver_test_email(User.current)
flash[:notice] = l(:notice_email_sent, User.current.mail)
rescue Exception => e
flash[:error] = l(:notice_email_error, e.message)
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 2502ce2e0..e54170604 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -290,12 +290,12 @@ class Mailer < ActionMailer::Base
render_multipart('register', body)
end
- def test(user)
+ def test_email(user)
set_language_if_valid(user.language)
recipients user.mail
subject 'Redmine test'
body :url => url_for(:controller => 'welcome')
- render_multipart('test', body)
+ render_multipart('test_email', body)
end
# Overrides default deliver! method to prevent from sending an email
diff --git a/app/views/mailer/test.html.erb b/app/views/mailer/test_email.html.erb
index 1e81b3bfe..1e81b3bfe 100644
--- a/app/views/mailer/test.html.erb
+++ b/app/views/mailer/test_email.html.erb
diff --git a/app/views/mailer/test.text.erb b/app/views/mailer/test_email.text.erb
index 790d6ab22..790d6ab22 100644
--- a/app/views/mailer/test.text.erb
+++ b/app/views/mailer/test_email.text.erb
diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake
index 0d6933134..4406544a8 100644
--- a/lib/tasks/email.rake
+++ b/lib/tasks/email.rake
@@ -176,7 +176,7 @@ END_DESC
ActionMailer::Base.raise_delivery_errors = true
begin
- Mailer.deliver_test(User.current)
+ Mailer.deliver_test_email(User.current)
puts l(:notice_email_sent, user.mail)
rescue Exception => e
abort l(:notice_email_error, e.message)
diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb
index 90e658905..2e136bfdc 100644
--- a/test/functional/admin_controller_test.rb
+++ b/test/functional/admin_controller_test.rb
@@ -91,7 +91,7 @@ class AdminControllerTest < ActionController::TestCase
end
def test_test_email_failure_should_display_the_error
- Mailer.stubs(:deliver_test).raises(Exception, 'Some error message')
+ Mailer.stubs(:deliver_test_email).raises(Exception, 'Some error message')
get :test_email
assert_redirected_to '/settings/edit?tab=notifications'
assert_match /Some error message/, flash[:error]
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 8ac1c5a80..6d652cb23 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -196,7 +196,7 @@ class MailerTest < ActiveSupport::TestCase
def test_from_header
with_settings :mail_from => 'redmine@example.net' do
- Mailer.deliver_test(User.find(1))
+ Mailer.deliver_test_email(User.find(1))
end
mail = last_email
assert_equal 'redmine@example.net', mail.from_addrs.first.address
@@ -204,7 +204,7 @@ class MailerTest < ActiveSupport::TestCase
def test_from_header_with_phrase
with_settings :mail_from => 'Redmine app <redmine@example.net>' do
- Mailer.deliver_test(User.find(1))
+ Mailer.deliver_test_email(User.find(1))
end
mail = last_email
assert_equal 'redmine@example.net', mail.from_addrs.first.address
@@ -461,7 +461,7 @@ class MailerTest < ActiveSupport::TestCase
user = User.find(1)
valid_languages.each do |lang|
user.update_attribute :language, lang.to_s
- assert Mailer.deliver_test(user)
+ assert Mailer.deliver_test_email(user)
end
end
@@ -522,7 +522,7 @@ class MailerTest < ActiveSupport::TestCase
def test_with_deliveries_off
Mailer.with_deliveries false do
- Mailer.deliver_test(User.find(1))
+ Mailer.deliver_test_email(User.find(1))
end
assert ActionMailer::Base.deliveries.empty?
# should restore perform_deliveries
@@ -539,7 +539,7 @@ class MailerTest < ActiveSupport::TestCase
def test_layout_should_include_the_emails_header
with_settings :emails_header => "*Header content*" do
- assert Mailer.deliver_test(User.find(1))
+ assert Mailer.deliver_test_email(User.find(1))
assert_select_email do
assert_select ".header" do
assert_select "strong", :text => "Header content"