aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-08-28 11:36:56 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-08-28 11:36:56 +0100
commit3e3945b2fafb9ccedfd9ff181c31b18f5d4cd0ce (patch)
treecd86abce0ab9accbbbf24018961464590fa6bb39 /actionmailer
parent5db2f199aba9aa8d00adefa8237922ad684aca03 (diff)
parent96c6fe084228d570dad80e3100830edb2bc0448d (diff)
downloadrails-3e3945b2fafb9ccedfd9ff181c31b18f5d4cd0ce.tar.gz
rails-3e3945b2fafb9ccedfd9ff181c31b18f5d4cd0ce.tar.bz2
rails-3e3945b2fafb9ccedfd9ff181c31b18f5d4cd0ce.zip
Merge commit 'mainstream/master'
Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/callbacks.rb activeresource/lib/active_resource/base.rb
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer.rb12
-rw-r--r--actionmailer/test/mail_render_test.rb12
2 files changed, 9 insertions, 15 deletions
diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb
index 2e324d4637..2a9210deb9 100644
--- a/actionmailer/lib/action_mailer.rb
+++ b/actionmailer/lib/action_mailer.rb
@@ -21,13 +21,13 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-unless defined?(ActionController)
- begin
- $:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
+begin
+ require 'action_controller'
+rescue LoadError
+ actionpack_path = "#{File.dirname(__FILE__)}/../../actionpack/lib"
+ if File.directory?(actionpack_path)
+ $:.unshift actionpack_path
require 'action_controller'
- rescue LoadError
- require 'rubygems'
- gem 'actionpack', '>= 1.12.5'
end
end
diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb
index fbcd1887e4..45811612eb 100644
--- a/actionmailer/test/mail_render_test.rb
+++ b/actionmailer/test/mail_render_test.rb
@@ -20,13 +20,13 @@ class RenderMailer < ActionMailer::Base
subject "rendering rxml template"
from "tester@example.com"
end
-
+
def included_subtemplate(recipient)
recipients recipient
subject "Including another template in the one being rendered"
from "tester@example.com"
end
-
+
def included_old_subtemplate(recipient)
recipients recipient
subject "Including another template in the one being rendered"
@@ -83,17 +83,11 @@ class RenderHelperTest < Test::Unit::TestCase
mail = RenderMailer.deliver_rxml_template(@recipient)
assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test/>", mail.body.strip
end
-
+
def test_included_subtemplate
mail = RenderMailer.deliver_included_subtemplate(@recipient)
assert_equal "Hey Ho, let's go!", mail.body.strip
end
-
- def test_deprecated_old_subtemplate
- assert_raises ActionView::ActionViewError do
- RenderMailer.deliver_included_old_subtemplate(@recipient)
- end
- end
end
class FirstSecondHelperTest < Test::Unit::TestCase