From b202856a635c49eb6ef9242f3f6472ee9fb0ea25 Mon Sep 17 00:00:00 2001 From: Ian White Date: Mon, 9 Feb 2009 13:31:58 +0000 Subject: [PATCH] Backported ActionMailer support from master(rails 2.3) branch --- History.txt | 2 ++ init.rb | 3 +++ spec/app.rb | 2 +- spec/mailers/mailer_spec.rb | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/History.txt b/History.txt index dbf0136..1a9fa4a 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,5 @@ +* Backported ActionMailer support from master branch + * render_parent is replaced with render :parent (works for normal templates and partials) * Removed render_parent for now (in edge rails version) diff --git a/init.rb b/init.rb index d13e535..6d63a4c 100644 --- a/init.rb +++ b/init.rb @@ -1,4 +1,7 @@ require 'ardes/inherit_views' +if defined?(ActionMailer) + ActionMailer::Base.send :extend, Ardes::InheritViews::ActionController +end ActionController::Base.send :extend, Ardes::InheritViews::ActionController ActionView::Base.send :include, Ardes::InheritViews::ActionView \ No newline at end of file diff --git a/spec/app.rb b/spec/app.rb index a8cd1ba..681d28e 100644 --- a/spec/app.rb +++ b/spec/app.rb @@ -43,5 +43,5 @@ def email # inherits views form normal mailer class InheritingMailer < NormalMailer - #inherit_views 'normal_mailer' + inherit_views 'normal_mailer' end \ No newline at end of file diff --git a/spec/mailers/mailer_spec.rb b/spec/mailers/mailer_spec.rb index 75bdbca..ab84e1b 100644 --- a/spec/mailers/mailer_spec.rb +++ b/spec/mailers/mailer_spec.rb @@ -6,6 +6,10 @@ ActionMailer::Base.perform_deliveries = true end + before :each do + ActionMailer::Base.deliveries.clear + end + describe NormalMailer do before :each do NormalMailer.deliver_email