diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 11:15:42 +1100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 11:15:42 +1100 |
commit | 258ca148004eaa63740ab2186338b3ac872b8187 (patch) | |
tree | 93901307abbe875d3f5913a1383896267db33bff /actionmailer/test | |
parent | e7e4ed48df3048f32d94e398e99d0048a66ba67e (diff) | |
download | rails-258ca148004eaa63740ab2186338b3ac872b8187.tar.gz rails-258ca148004eaa63740ab2186338b3ac872b8187.tar.bz2 rails-258ca148004eaa63740ab2186338b3ac872b8187.zip |
Delegated ActionMailer::Base.deliveries to Mail.deliveries, added callback support in Mail to call ActionMailer on delivery, moved deliver to deprecated API in preparation for new API
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/asset_host_test.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/base_test.rb | 9 | ||||
-rw-r--r-- | actionmailer/test/mail_helper_test.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/mail_layout_test.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/mail_render_test.rb | 4 | ||||
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 6 | ||||
-rw-r--r-- | actionmailer/test/url_test.rb | 2 |
7 files changed, 18 insertions, 9 deletions
diff --git a/actionmailer/test/asset_host_test.rb b/actionmailer/test/asset_host_test.rb index f3383e5608..7ba78b6daa 100644 --- a/actionmailer/test/asset_host_test.rb +++ b/actionmailer/test/asset_host_test.rb @@ -12,7 +12,7 @@ class AssetHostTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index ad0e1d9fe2..43a9fb29bb 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -324,6 +324,15 @@ class BaseTest < ActiveSupport::TestCase assert_equal("Format with any!", email.parts[1].body.encoded) end + test "ActionMailer should be told when Mail gets delivered" do + BaseMailer.expects(:delivered_email).once + email = BaseMailer.deliver_welcome + end + + # test "ActionMailer should be told when Mail gets delivered using new API" do + # BaseMailer.expects(:delivered_email).once + # email = BaseMailer.welcome.deliver + # end protected diff --git a/actionmailer/test/mail_helper_test.rb b/actionmailer/test/mail_helper_test.rb index 2d3565d159..d81bc57ce0 100644 --- a/actionmailer/test/mail_helper_test.rb +++ b/actionmailer/test/mail_helper_test.rb @@ -63,7 +63,7 @@ class MailerHelperTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end diff --git a/actionmailer/test/mail_layout_test.rb b/actionmailer/test/mail_layout_test.rb index b9ff075461..b4bd583616 100644 --- a/actionmailer/test/mail_layout_test.rb +++ b/actionmailer/test/mail_layout_test.rb @@ -55,7 +55,7 @@ class LayoutMailerTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb index 09ce5e4854..3424823c99 100644 --- a/actionmailer/test/mail_render_test.rb +++ b/actionmailer/test/mail_render_test.rb @@ -86,7 +86,7 @@ class RenderHelperTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end @@ -135,7 +135,7 @@ class FirstSecondHelperTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 62422fb4b3..df5afda447 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -337,7 +337,7 @@ class ActionMailerTest < Test::Unit::TestCase set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @original_logger = TestMailer.logger @recipient = 'test@localhost' @@ -658,7 +658,7 @@ class ActionMailerTest < Test::Unit::TestCase def test_doesnt_raise_errors_when_raise_delivery_errors_is_false ActionMailer::Base.raise_delivery_errors = false - Mail::Message.any_instance.expects(:deliver!).raises(Exception) + Mail::TestMailer.any_instance.expects(:deliver!).raises(Exception) assert_nothing_raised { TestMailer.deliver_signed_up(@recipient) } end @@ -1113,7 +1113,7 @@ class MethodNamingTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear end def teardown diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index 12bf609dce..b7ae5304ed 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -44,7 +44,7 @@ class ActionMailerUrlTest < Test::Unit::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] + ActionMailer::Base.deliveries.clear @recipient = 'test@localhost' end |