aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-03-11 22:05:15 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-03-11 22:05:15 +1100
commitf5774e3e3f70a3acfa559b9ff889e9417fb71d4b (patch)
treee738112994d40d6c3792065da80bddfa7439467b /actionmailer/test
parentcefe723e285f20d1f2a33f67da03348568f7e0b0 (diff)
parent073852dff0b48296a9a184f94e722183334f3c4c (diff)
downloadrails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.tar.gz
rails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.tar.bz2
rails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/log_subscriber_test.rb6
-rw-r--r--actionmailer/test/old_base/asset_host_test.rb9
-rw-r--r--actionmailer/test/old_base/url_test.rb4
3 files changed, 15 insertions, 4 deletions
diff --git a/actionmailer/test/log_subscriber_test.rb b/actionmailer/test/log_subscriber_test.rb
index edd7c84d29..c08c34b4a2 100644
--- a/actionmailer/test/log_subscriber_test.rb
+++ b/actionmailer/test/log_subscriber_test.rb
@@ -4,7 +4,11 @@ require "action_mailer/railties/log_subscriber"
class AMLogSubscriberTest < ActionMailer::TestCase
include Rails::LogSubscriber::TestHelper
- Rails::LogSubscriber.add(:action_mailer, ActionMailer::Railties::LogSubscriber.new)
+
+ def setup
+ super
+ Rails::LogSubscriber.add(:action_mailer, ActionMailer::Railties::LogSubscriber.new)
+ end
class TestMailer < ActionMailer::Base
def basic
diff --git a/actionmailer/test/old_base/asset_host_test.rb b/actionmailer/test/old_base/asset_host_test.rb
index aa9cfd88dd..0ec0242f55 100644
--- a/actionmailer/test/old_base/asset_host_test.rb
+++ b/actionmailer/test/old_base/asset_host_test.rb
@@ -14,6 +14,10 @@ class AssetHostTest < Test::Unit::TestCase
set_delivery_method :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries.clear
+ AssetHostMailer.configure do |c|
+ c.asset_host = "http://www.example.com"
+ c.assets_dir = ''
+ end
end
def teardown
@@ -21,13 +25,12 @@ class AssetHostTest < Test::Unit::TestCase
end
def test_asset_host_as_string
- ActionController::Base.asset_host = "http://www.example.com"
mail = AssetHostMailer.email_with_asset
assert_equal "<img alt=\"Somelogo\" src=\"http://www.example.com/images/somelogo.png\" />", mail.body.to_s.strip
end
def test_asset_host_as_one_arguement_proc
- ActionController::Base.asset_host = Proc.new { |source|
+ AssetHostMailer.config.asset_host = Proc.new { |source|
if source.starts_with?('/images')
"http://images.example.com"
else
@@ -39,7 +42,7 @@ class AssetHostTest < Test::Unit::TestCase
end
def test_asset_host_as_two_arguement_proc
- ActionController::Base.asset_host = Proc.new {|source,request|
+ ActionController::Base.config.asset_host = Proc.new {|source,request|
if request && request.ssl?
"https://www.example.com"
else
diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb
index a719248599..60740d6b0b 100644
--- a/actionmailer/test/old_base/url_test.rb
+++ b/actionmailer/test/old_base/url_test.rb
@@ -13,6 +13,10 @@ end
class TestMailer < ActionMailer::Base
default_url_options[:host] = 'www.basecamphq.com'
+ configure do |c|
+ c.assets_dir = '' # To get the tests to pass
+ end
+
def signed_up_with_url(recipient)
@recipients = recipient
@subject = "[Signed up] Welcome #{recipient}"