aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/delivery_method_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-08-07 20:56:54 -0700
committerMichael Koziarski <michael@koziarski.com>2009-08-08 16:32:17 +1200
commitfbe6c3c19553fd05edc904af62fbfc8aee1d907d (patch)
treedab8152b9c8b0c0afa5c78682044ef41adb18135 /actionmailer/test/delivery_method_test.rb
parent54e7f5ba435b7573c68c7acd65c9d2537427de7e (diff)
downloadrails-fbe6c3c19553fd05edc904af62fbfc8aee1d907d.tar.gz
rails-fbe6c3c19553fd05edc904af62fbfc8aee1d907d.tar.bz2
rails-fbe6c3c19553fd05edc904af62fbfc8aee1d907d.zip
Adds a :file delivery_method to save email to a file on disk
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2438 state:committed]
Diffstat (limited to 'actionmailer/test/delivery_method_test.rb')
-rw-r--r--actionmailer/test/delivery_method_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/actionmailer/test/delivery_method_test.rb b/actionmailer/test/delivery_method_test.rb
index 0731512ea4..1b8c3ba523 100644
--- a/actionmailer/test/delivery_method_test.rb
+++ b/actionmailer/test/delivery_method_test.rb
@@ -7,6 +7,10 @@ class NonDefaultDeliveryMethodMailer < ActionMailer::Base
self.delivery_method = :sendmail
end
+class FileDeliveryMethodMailer < ActionMailer::Base
+ self.delivery_method = :file
+end
+
class ActionMailerBase_delivery_method_Test < Test::Unit::TestCase
def setup
set_delivery_method :smtp
@@ -49,3 +53,21 @@ class NonDefaultDeliveryMethodMailer_delivery_method_Test < Test::Unit::TestCase
end
end
+class FileDeliveryMethodMailer_delivery_method_Test < Test::Unit::TestCase
+ def setup
+ set_delivery_method :smtp
+ end
+
+ def teardown
+ restore_delivery_method
+ end
+
+ def test_should_be_the_set_delivery_method
+ assert_equal :file, FileDeliveryMethodMailer.delivery_method
+ end
+
+ def test_should_default_location_to_the_tmpdir
+ assert_equal "#{Dir.tmpdir}/mails", ActionMailer::Base.file_settings[:location]
+ end
+end
+