Fix ActionMailer tests that depend on run order

This commit is contained in:
Francesco Rodriguez 2012-08-23 16:15:31 -05:00
parent 961957d570
commit 73f0afd1d4
1 changed files with 9 additions and 5 deletions

View File

@ -493,14 +493,18 @@ class BaseTest < ActiveSupport::TestCase
end
test "assets tags should use a Mailer's asset_host settings when available" do
ActionMailer::Base.config.asset_host = "global.com"
ActionMailer::Base.config.assets_dir = "global/"
begin
ActionMailer::Base.config.asset_host = "http://global.com"
ActionMailer::Base.config.assets_dir = "global/"
AssetMailer.asset_host = "http://local.com"
AssetMailer.asset_host = "http://local.com"
mail = AssetMailer.welcome
mail = AssetMailer.welcome
assert_equal(%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}, mail.body.to_s.strip)
assert_equal(%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}, mail.body.to_s.strip)
ensure
AssetMailer.asset_host = ActionMailer::Base.config.asset_host
end
end
# Before and After hooks