aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-08-23 16:15:31 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-08-23 16:15:31 -0500
commit73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc (patch)
tree0f9315eaec5de5b9e5c08cd6859618b8290e7585 /actionmailer/test
parent961957d5709b6e18a0c6adf0b4783297cc21140a (diff)
downloadrails-73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc.tar.gz
rails-73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc.tar.bz2
rails-73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc.zip
Fix ActionMailer tests that depend on run order
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 4ed332d13d..fcf5be56f7 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -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