diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-22 13:34:57 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-22 13:34:57 +0000 |
commit | 148f6d8fb6ea028b2738a0553f058e903268a0b8 (patch) | |
tree | edfc549dd7793ff03cd78e92c521f037060e4b50 /railties/lib/rails_generator/generators/components/mailer | |
parent | cf659de14140950638f2f02831a42721fd8d2f75 (diff) | |
download | rails-148f6d8fb6ea028b2738a0553f058e903268a0b8.tar.gz rails-148f6d8fb6ea028b2738a0553f058e903268a0b8.tar.bz2 rails-148f6d8fb6ea028b2738a0553f058e903268a0b8.zip |
Made Action Mailer templates use UTF-8 as default
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators/components/mailer')
-rw-r--r-- | railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb b/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb index 70fd3afe37..0874a6fd91 100644 --- a/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +++ b/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb @@ -3,6 +3,7 @@ require '<%= file_name %>' class <%= class_name %>Test < Test::Unit::TestCase FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' + CHARSET = "utf-8" def setup ActionMailer::Base.delivery_method = :test @@ -10,11 +11,12 @@ class <%= class_name %>Test < Test::Unit::TestCase ActionMailer::Base.deliveries = [] @expected = TMail::Mail.new + @expected.set_content_type "text", "plain", { "charset" => CHARSET } end <% for action in actions -%> def test_<%= action %> - @expected.subject = '<%= class_name %>#<%= action %>' + @expected.subject = encode '<%= class_name %>#<%= action %>' @expected.body = read_fixture('<%= action %>') @expected.date = Time.now @@ -26,4 +28,8 @@ class <%= class_name %>Test < Test::Unit::TestCase def read_fixture(action) IO.readlines("#{FIXTURES_PATH}/<%= file_name %>/#{action}") end + + def encode(subject) + ActionMailer::Base.quoted_printable(subject, CHARSET) + end end |