]> source.dussan.org Git - redmine.git/commitdiff
Renamed Mailer#test to Mailer#test_email.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Mar 2012 12:38:34 +0000 (12:38 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Mar 2012 12:38:34 +0000 (12:38 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9080 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/admin_controller.rb
app/models/mailer.rb
app/views/mailer/test.html.erb [deleted file]
app/views/mailer/test.text.erb [deleted file]
app/views/mailer/test_email.html.erb [new file with mode: 0644]
app/views/mailer/test_email.text.erb [new file with mode: 0644]
lib/tasks/email.rake
test/functional/admin_controller_test.rb
test/unit/mailer_test.rb

index dd3e912368f1cec52eb022470456112699769198..9684f5cbfca0f1abd6e2d379b23d573a4473c546 100644 (file)
@@ -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)
index 2502ce2e04f02d9ee1f494129481232099f5b2d4..e54170604e3c3bc6b57a2243d6651ab50eadc48e 100644 (file)
@@ -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.html.erb
deleted file mode 100644 (file)
index 1e81b3b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<p>This is a test email sent by Redmine.<br />
-Redmine URL: <%= link_to h(@url), @url %></p>
diff --git a/app/views/mailer/test.text.erb b/app/views/mailer/test.text.erb
deleted file mode 100644 (file)
index 790d6ab..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-This is a test email sent by Redmine.
-Redmine URL: <%= @url %>
diff --git a/app/views/mailer/test_email.html.erb b/app/views/mailer/test_email.html.erb
new file mode 100644 (file)
index 0000000..1e81b3b
--- /dev/null
@@ -0,0 +1,2 @@
+<p>This is a test email sent by Redmine.<br />
+Redmine URL: <%= link_to h(@url), @url %></p>
diff --git a/app/views/mailer/test_email.text.erb b/app/views/mailer/test_email.text.erb
new file mode 100644 (file)
index 0000000..790d6ab
--- /dev/null
@@ -0,0 +1,2 @@
+This is a test email sent by Redmine.
+Redmine URL: <%= @url %>
index 0d69331342a07e48b1f15bc2267bb3d6984740c7..4406544a86ec42383f1076a0e80356e043036452 100644 (file)
@@ -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)
index 90e6589053366a1fe0b81de737c31fd5c2c3200c..2e136bfdc67426801e8875636fa28dcf6738f8ec 100644 (file)
@@ -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]
index 8ac1c5a80e55695be96d88686def52c0ddac63a4..6d652cb23765f2908343ae5ef161d6743daf4ff1 100644 (file)
@@ -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"