aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/old_base/mail_service_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test/old_base/mail_service_test.rb')
-rw-r--r--actionmailer/test/old_base/mail_service_test.rb112
1 files changed, 3 insertions, 109 deletions
diff --git a/actionmailer/test/old_base/mail_service_test.rb b/actionmailer/test/old_base/mail_service_test.rb
index a216b94a55..93921978b6 100644
--- a/actionmailer/test/old_base/mail_service_test.rb
+++ b/actionmailer/test/old_base/mail_service_test.rb
@@ -334,6 +334,7 @@ class ActionMailerTest < Test::Unit::TestCase
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.deliveries.clear
+ ActiveSupport::Deprecation.silenced = true
@original_logger = TestMailer.logger
@recipient = 'test@localhost'
@@ -343,6 +344,7 @@ class ActionMailerTest < Test::Unit::TestCase
def teardown
TestMailer.logger = @original_logger
+ ActiveSupport::Deprecation.silenced = false
restore_delivery_method
end
@@ -1095,112 +1097,4 @@ EOF
ensure
TestMailer.smtp_settings.merge!(:enable_starttls_auto => true)
end
-end
-
-class InheritableTemplateRootTest < ActiveSupport::TestCase
- def test_attr
- expected = File.expand_path("#{File.dirname(__FILE__)}/../fixtures/path.with.dots")
- assert_equal expected, FunkyPathMailer.template_root.to_s
-
- sub = Class.new(FunkyPathMailer)
- assert_deprecated do
- sub.template_root = 'test/path'
- end
-
- assert_equal File.expand_path('test/path'), sub.template_root.to_s
- assert_equal expected, FunkyPathMailer.template_root.to_s
- end
-end
-
-class MethodNamingTest < ActiveSupport::TestCase
- include ActionMailer::TestHelper
-
- class TestMailer < ActionMailer::Base
- def send
- body 'foo'
- end
- end
-
- def setup
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries.clear
- end
-
- def teardown
- restore_delivery_method
- end
-
- def test_send_method
- assert_nothing_raised do
- assert_emails 1 do
- assert_deprecated do
- TestMailer.deliver_send
- end
- end
- end
- end
-end
-class RespondToTest < Test::Unit::TestCase
- class RespondToMailer < ActionMailer::Base; end
-
- def setup
- set_delivery_method :test
- end
-
- def teardown
- restore_delivery_method
- end
-
- def test_should_respond_to_new
- assert_respond_to RespondToMailer, :new
- end
-
- def test_should_respond_to_create_with_template_suffix
- assert_respond_to RespondToMailer, :create_any_old_template
- end
-
- def test_should_respond_to_deliver_with_template_suffix
- assert_respond_to RespondToMailer, :deliver_any_old_template
- end
-
- def test_should_not_respond_to_new_with_template_suffix
- assert !RespondToMailer.respond_to?(:new_any_old_template)
- end
-
- def test_should_not_respond_to_create_with_template_suffix_unless_it_is_separated_by_an_underscore
- assert !RespondToMailer.respond_to?(:createany_old_template)
- end
-
- def test_should_not_respond_to_deliver_with_template_suffix_unless_it_is_separated_by_an_underscore
- assert !RespondToMailer.respond_to?(:deliverany_old_template)
- end
-
- def test_should_not_respond_to_create_with_template_suffix_if_it_begins_with_a_uppercase_letter
- assert !RespondToMailer.respond_to?(:create_Any_old_template)
- end
-
- def test_should_not_respond_to_deliver_with_template_suffix_if_it_begins_with_a_uppercase_letter
- assert !RespondToMailer.respond_to?(:deliver_Any_old_template)
- end
-
- def test_should_not_respond_to_create_with_template_suffix_if_it_begins_with_a_digit
- assert !RespondToMailer.respond_to?(:create_1_template)
- end
-
- def test_should_not_respond_to_deliver_with_template_suffix_if_it_begins_with_a_digit
- assert !RespondToMailer.respond_to?(:deliver_1_template)
- end
-
- def test_should_not_respond_to_method_where_deliver_is_not_a_suffix
- assert !RespondToMailer.respond_to?(:foo_deliver_template)
- end
-
- def test_should_still_raise_exception_with_expected_message_when_calling_an_undefined_method
- error = assert_raise NoMethodError do
- RespondToMailer.not_a_method
- end
-
- assert_match(/method.*not_a_method/, error.message)
- end
-end
+end \ No newline at end of file