aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/abstract_unit.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/abstract_unit.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/abstract_unit.rb')
-rw-r--r--actionmailer/test/abstract_unit.rb24
1 files changed, 5 insertions, 19 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 1fc5ab85e0..781e49ae05 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -8,7 +8,6 @@ $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
require 'rubygems'
require 'test/unit'
-
require 'action_mailer'
# Show backtraces for deprecated behavior for quicker cleanup.
@@ -18,15 +17,11 @@ ActiveSupport::Deprecation.debug = true
ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!".inspect }
ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup".inspect }
-ActionView::Base::DEFAULT_CONFIG = { :assets_dir => '/nowhere' }
-
-$:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers"
+FIXTURE_LOAD_PATH = File.expand_path('fixtures', File.dirname(__FILE__))
+ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
+$:.unshift File.join(FIXTURE_LOAD_PATH, 'helpers')
-FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
-ActionMailer::Base.template_root = FIXTURE_LOAD_PATH
-
-class MockSMTP
-
+class MockSMTP
def self.deliveries
@@deliveries
end
@@ -42,7 +37,6 @@ class MockSMTP
def start(*args)
yield self
end
-
end
class Net::SMTP
@@ -51,14 +45,6 @@ class Net::SMTP
end
end
-def uses_gem(gem_name, test_name, version = '> 0')
- gem gem_name.to_s, version
- require gem_name.to_s
- yield
-rescue LoadError
- $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
-end
-
def set_delivery_method(method)
@old_delivery_method = ActionMailer::Base.delivery_method
ActionMailer::Base.delivery_method = method
@@ -66,4 +52,4 @@ end
def restore_delivery_method
ActionMailer::Base.delivery_method = @old_delivery_method
-end
+end \ No newline at end of file