From b4be8849c0de81841c458c0f059787a9cc9bc022 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 28 Mar 2009 00:38:57 +0000 Subject: Added observers to watch model objects for mail delivery instead of calling Mailer. * Added an IssueObserver to watch when Issues are created * Added a JournalObserver to watch when Journals are created (Issue updates) * Added a NewsObserver for News items. * Added a DocumentObserver for Document notifications. * Setup IssuesController#new to use the IssueObserver. * Setup IssuesController#edit to use the IssueObserver. * Setup IssuesController#bulk_edit to use the JournalObserver. * Removed the Mailer call in Changeset#scan_commit_for_issue_ids, the JournalObserver will handle it. * Removed Mailer calls in MailHandler in favor of the Observers. #2659 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2637 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/journal_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/unit/journal_test.rb') diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb index b177f3198..147af4aae 100644 --- a/test/unit/journal_test.rb +++ b/test/unit/journal_test.rb @@ -36,4 +36,15 @@ class JournalTest < Test::Unit::TestCase assert_kind_of IssueStatus, status assert_equal 2, status.id end + + def test_create_should_send_email_notification + ActionMailer::Base.deliveries.clear + issue = Issue.find(:first) + user = User.find(:first) + journal = issue.init_journal(user, issue) + + assert journal.save + assert_equal 1, ActionMailer::Base.deliveries.size + end + end -- cgit v1.2.3