diff options
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/abstract_unit.rb | 15 | ||||
-rw-r--r-- | actionmailer/test/asset_host_test.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/base_test.rb | 4 | ||||
-rw-r--r-- | actionmailer/test/mail_layout_test.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/mailers/base_mailer.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/test_test.rb | 28 |
6 files changed, 39 insertions, 14 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index 0b076e1ff9..3a519253f9 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -13,20 +13,17 @@ end require 'active_support/core_ext/kernel/reporting' -require 'active_support/core_ext/string/encoding' -if "ruby".encoding_aware? - # These are the normal settings that will be set up by Railties - # TODO: Have these tests support other combinations of these values - silence_warnings do - Encoding.default_internal = "UTF-8" - Encoding.default_external = "UTF-8" - end +# These are the normal settings that will be set up by Railties +# TODO: Have these tests support other combinations of these values +silence_warnings do + Encoding.default_internal = "UTF-8" + Encoding.default_external = "UTF-8" end lib = File.expand_path("#{File.dirname(__FILE__)}/../lib") $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib) -require 'test/unit' +require 'minitest/autorun' require 'action_mailer' require 'action_mailer/test_case' diff --git a/actionmailer/test/asset_host_test.rb b/actionmailer/test/asset_host_test.rb index b24eca5fbb..696a9f1174 100644 --- a/actionmailer/test/asset_host_test.rb +++ b/actionmailer/test/asset_host_test.rb @@ -9,7 +9,7 @@ class AssetHostMailer < ActionMailer::Base end end -class AssetHostTest < Test::Unit::TestCase +class AssetHostTest < ActiveSupport::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index 9fdd0e1ced..65550ab505 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -107,7 +107,7 @@ class BaseTest < ActiveSupport::TestCase assert_equal(1, email.attachments.length) assert_equal('invoice.jpg', email.attachments[0].filename) expected = "\312\213\254\232)b" - expected.force_encoding(Encoding::BINARY) if '1.9'.respond_to?(:force_encoding) + expected.force_encoding(Encoding::BINARY) assert_equal expected, email.attachments['invoice.jpg'].decoded end @@ -116,7 +116,7 @@ class BaseTest < ActiveSupport::TestCase assert_equal(1, email.attachments.length) assert_equal('invoice.jpg', email.attachments[0].filename) expected = "\312\213\254\232)b" - expected.force_encoding(Encoding::BINARY) if '1.9'.respond_to?(:force_encoding) + expected.force_encoding(Encoding::BINARY) assert_equal expected, email.attachments['invoice.jpg'].decoded end diff --git a/actionmailer/test/mail_layout_test.rb b/actionmailer/test/mail_layout_test.rb index def8da81b8..71e93c29f1 100644 --- a/actionmailer/test/mail_layout_test.rb +++ b/actionmailer/test/mail_layout_test.rb @@ -43,7 +43,7 @@ class ExplicitLayoutMailer < ActionMailer::Base end end -class LayoutMailerTest < Test::Unit::TestCase +class LayoutMailerTest < ActiveSupport::TestCase def setup set_delivery_method :test ActionMailer::Base.perform_deliveries = true diff --git a/actionmailer/test/mailers/base_mailer.rb b/actionmailer/test/mailers/base_mailer.rb index 9416bc718e..e55d72fdb4 100644 --- a/actionmailer/test/mailers/base_mailer.rb +++ b/actionmailer/test/mailers/base_mailer.rb @@ -113,6 +113,6 @@ class BaseMailer < ActionMailer::Base end def email_with_translations - mail :body => render("email_with_translations.html") + mail :body => render("email_with_translations", :formats => [:html]) end end diff --git a/actionmailer/test/test_test.rb b/actionmailer/test/test_test.rb new file mode 100644 index 0000000000..86fd37bea6 --- /dev/null +++ b/actionmailer/test/test_test.rb @@ -0,0 +1,28 @@ +require 'abstract_unit' + +class TestTestMailer < ActionMailer::Base +end + +class CrazyNameMailerTest < ActionMailer::TestCase + tests TestTestMailer + + def test_set_mailer_class_manual + assert_equal TestTestMailer, self.class.mailer_class + end +end + +class CrazySymbolNameMailerTest < ActionMailer::TestCase + tests :test_test_mailer + + def test_set_mailer_class_manual_using_symbol + assert_equal TestTestMailer, self.class.mailer_class + end +end + +class CrazyStringNameMailerTest < ActionMailer::TestCase + tests 'test_test_mailer' + + def test_set_mailer_class_manual_using_string + assert_equal TestTestMailer, self.class.mailer_class + end +end |