aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/asset_host_test.rb
diff options
context:
space:
mode:
authorJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-24 19:36:42 +0100
committerJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-24 19:36:42 +0100
commitbd96614101262e0ad0cc176ed8e2d95a5c17936b (patch)
tree1612a3baaf634bd180b2b145db12b7eeb3096010 /actionmailer/test/asset_host_test.rb
parent99f960a3d73b62a957988bbee0906264f35afc2e (diff)
downloadrails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.tar.gz
rails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.tar.bz2
rails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.zip
Move old tests to a specific folder and add some delivery method tests.
Diffstat (limited to 'actionmailer/test/asset_host_test.rb')
-rw-r--r--actionmailer/test/asset_host_test.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/actionmailer/test/asset_host_test.rb b/actionmailer/test/asset_host_test.rb
deleted file mode 100644
index 124032f1d9..0000000000
--- a/actionmailer/test/asset_host_test.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'abstract_unit'
-
-class AssetHostMailer < ActionMailer::Base
- def email_with_asset
- recipients 'test@localhost'
- subject "testing email containing asset path while asset_host is set"
- from "tester@example.com"
- end
-end
-
-class AssetHostTest < Test::Unit::TestCase
- def setup
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries.clear
- end
-
- def teardown
- restore_delivery_method
- end
-
- def test_asset_host_as_string
- ActionController::Base.asset_host = "http://www.example.com"
- mail = AssetHostMailer.email_with_asset
- assert_equal "<img alt=\"Somelogo\" src=\"http://www.example.com/images/somelogo.png\" />", mail.body.to_s.strip
- end
-
- def test_asset_host_as_one_arguement_proc
- ActionController::Base.asset_host = Proc.new { |source|
- if source.starts_with?('/images')
- "http://images.example.com"
- else
- "http://assets.example.com"
- end
- }
- mail = AssetHostMailer.email_with_asset
- assert_equal "<img alt=\"Somelogo\" src=\"http://images.example.com/images/somelogo.png\" />", mail.body.to_s.strip
- end
-
- def test_asset_host_as_two_arguement_proc
- ActionController::Base.asset_host = Proc.new {|source,request|
- if request && request.ssl?
- "https://www.example.com"
- else
- "http://www.example.com"
- end
- }
- mail = nil
- assert_nothing_raised { mail = AssetHostMailer.email_with_asset }
- assert_equal "<img alt=\"Somelogo\" src=\"http://www.example.com/images/somelogo.png\" />", mail.body.to_s.strip
- end
-end \ No newline at end of file