Update the ActionMailer tests to run off of the latest ActionController config refactor

This commit is contained in:
Carl Lerche 2010-03-04 01:12:16 -08:00
parent ad2e6ee4ec
commit 05b9382e29
2 changed files with 8 additions and 5 deletions

View File

@ -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,11 +25,6 @@ class AssetHostTest < Test::Unit::TestCase
end
def test_asset_host_as_string
ActionMailer::Base.configure do |c|
c.asset_host = "http://www.example.com"
c.assets_dir = File.dirname(__FILE__)
end
mail = AssetHostMailer.email_with_asset
assert_equal "<img alt=\"Somelogo\" src=\"http://www.example.com/images/somelogo.png\" />", mail.body.to_s.strip
end

View File

@ -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}"