diff options
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 96c00a4098..f9365ea90c 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -296,6 +296,12 @@ class TestMailer < ActionMailer::Base body :body => "foo", :bar => "baz" end + def subject_with_i18n(recipient) + recipients recipient + from "system@loudthinking.com" + render :text => "testing" + end + class << self attr_accessor :received_body end @@ -392,6 +398,15 @@ class ActionMailerTest < Test::Unit::TestCase assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded end + def test_subject_with_i18n + assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) } + assert_equal "Subject with i18n", ActionMailer::Base.deliveries.first.subject + + I18n.backend.store_translations('en', :actionmailer => {:subjects => {:test_mailer => {:subject_with_i18n => "New Subject!"}}}) + assert_nothing_raised { TestMailer.deliver_subject_with_i18n(@recipient) } + assert_equal "New Subject!", ActionMailer::Base.deliveries.last.subject + end + def test_custom_template expected = new_mail expected.to = @recipient |