Permalink
Browse files

Fix ActionMailer tests that depend on run order

  • Loading branch information...
1 parent 961957d commit 73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc Francesco Rodriguez committed Aug 23, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 actionmailer/test/base_test.rb
@@ -493,14 +493,18 @@ def stub_queue(klass, queue)
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

0 comments on commit 73f0afd

Please sign in to comment.