diff options
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 4 | ||||
-rw-r--r-- | actionmailer/test/abstract_unit.rb | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index f1273eb02e..c878a8d205 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -570,7 +570,9 @@ module ActionMailer #:nodoc: end def candidate_for_layout?(options) - !@template.send(:_exempt_from_layout?, default_template_name) + !self.view_paths.find_template(default_template_name, default_template_format).exempt_from_layout? + rescue ActionView::MissingTemplate + return true end def template_root diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index ad1eac912b..4900f6fb35 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -10,11 +10,14 @@ require 'action_mailer/test_case' ActiveSupport::Deprecation.debug = true # Bogus template processors -ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!" } -ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup" } +ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!".inspect } +ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup".inspect } $:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers" -ActionMailer::Base.template_root = "#{File.dirname(__FILE__)}/fixtures" + +FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') +ActionMailer::Base.template_root = FIXTURE_LOAD_PATH +ActionMailer::Base.template_root.load class MockSMTP def self.deliveries |