diff options
author | athonlab <akshay.surve@gmail.com> | 2008-10-11 23:43:53 +0530 |
---|---|---|
committer | athonlab <akshay.surve@gmail.com> | 2008-10-11 23:43:53 +0530 |
commit | 4d25326f1bffc0783328e237be1930dfcb737d82 (patch) | |
tree | ebda8a9e36a880df6ac82a38f31f4621444924c3 /railties/doc | |
parent | cc5e6f5cc2ae3650fe7dc38100bd55cc1453c596 (diff) | |
download | rails-4d25326f1bffc0783328e237be1930dfcb737d82.tar.gz rails-4d25326f1bffc0783328e237be1930dfcb737d82.tar.bz2 rails-4d25326f1bffc0783328e237be1930dfcb737d82.zip |
Removes the 'Filtering emails in development' section from testing guide.
Diffstat (limited to 'railties/doc')
-rw-r--r-- | railties/doc/guides/testing_rails_applications/testing_rails_applications.txt | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/railties/doc/guides/testing_rails_applications/testing_rails_applications.txt b/railties/doc/guides/testing_rails_applications/testing_rails_applications.txt index 11ff2e6a41..f8bfc66b79 100644 --- a/railties/doc/guides/testing_rails_applications/testing_rails_applications.txt +++ b/railties/doc/guides/testing_rails_applications/testing_rails_applications.txt @@ -900,38 +900,6 @@ class MyControllerTest < Test::Unit::TestCase end ---------------------------------------------------------------- -=== Filtering emails in development === - -Sometimes you want to be somewhere inbetween the `:test` and `:smtp` settings. Say you're working on your development site, and you have a few testers working with you. The site isn't in production yet, but you'd like the testers to be able to receive emails from the site, but no one else. Here's a handy way to handle that situation, add this to your 'environment.rb' or 'development.rb' file - -[source, ruby] ----------------------------------------------------------------- -class ActionMailer::Base - - def perform_delivery_fixed_email(mail) - destinations = mail.destinations - if destinations.nil? - destinations = ["mymail@me.com"] - mail.subject = '[TEST-FAILURE]:'+mail.subject - else - mail.subject = '[TEST]:'+mail.subject - end - approved = ["testerone@me.com","testertwo@me.com"] - destinations = destinations.collect{|x| approved.collect{|y| (x==y ? x : nil)}}.flatten.compact - mail.to = destinations - if destinations.size > 0 - mail.ready_to_send - Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain], - server_settings[:user_name], server_settings[:password], server_settings[:authentication]) do |smtp| - smtp.sendmail(mail.encoded, mail.from, destinations) - end - end - - end - -end ----------------------------------------------------------------- - == Guide TODO == * Describe _setup_ and _teardown_ * Examples for integration test |