Skip to content

Commit

Permalink
Fix ActionMailer tests that depend on run order
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Rodriguez committed Aug 23, 2012
1 parent 961957d commit 73f0afd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions actionmailer/test/base_test.rb
Expand Up @@ -493,14 +493,18 @@ def stub_queue(klass, queue)
end end


test "assets tags should use a Mailer's asset_host settings when available" do test "assets tags should use a Mailer's asset_host settings when available" do
ActionMailer::Base.config.asset_host = "global.com" begin
ActionMailer::Base.config.assets_dir = "global/" 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 end


# Before and After hooks # Before and After hooks
Expand Down

0 comments on commit 73f0afd

Please sign in to comment.