Commit 1fcdecaaf5124d4fdf13354d9f2e27668cc51cbd
1 parent
f22cec83
Exists in
staging
and in
42 other branches
ActionItem96: adding TaskMailer class
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@613 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
29 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +require File.dirname(__FILE__) + '/../test_helper' | |
| 2 | + | |
| 3 | +class TaskMailerTest < Test::Unit::TestCase | |
| 4 | + FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' | |
| 5 | + CHARSET = "utf-8" | |
| 6 | + | |
| 7 | + include ActionMailer::Quoting | |
| 8 | + | |
| 9 | + def setup | |
| 10 | + ActionMailer::Base.delivery_method = :test | |
| 11 | + ActionMailer::Base.perform_deliveries = true | |
| 12 | + ActionMailer::Base.deliveries = [] | |
| 13 | + | |
| 14 | + @expected = TMail::Mail.new | |
| 15 | + @expected.set_content_type "text", "plain", { "charset" => CHARSET } | |
| 16 | + @expected.mime_version = '1.0' | |
| 17 | + end | |
| 18 | + | |
| 19 | + private | |
| 20 | + def read_fixture(action) | |
| 21 | + IO.readlines("#{FIXTURES_PATH}/task_mailer/#{action}") | |
| 22 | + end | |
| 23 | + | |
| 24 | + def encode(subject) | |
| 25 | + quoted_printable(subject, CHARSET) | |
| 26 | + end | |
| 27 | +end | ... | ... |