diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-19 22:09:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-19 22:09:31 +0000 |
commit | a45622585279603ff5b336c78019812a7bef3d37 (patch) | |
tree | 107d9eef9951eaec761905c0869bd624628d7a0f /test | |
parent | 5f871e965746d6c3e3642d74a321516d13aa66dc (diff) | |
download | redmine-a45622585279603ff5b336c78019812a7bef3d37.tar.gz redmine-a45622585279603ff5b336c78019812a7bef3d37.zip |
Add email notification to IssuesController#edit.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1018 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/issues_controller_test.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index ebcf78f24..06d2f1029 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -112,9 +112,21 @@ class IssuesControllerTest < Test::Unit::TestCase def test_post_edit @request.session[:user_id] = 2 - post :edit, :id => 1, :issue => {:subject => 'Modified subject'} + ActionMailer::Base.deliveries.clear + + issue = Issue.find(1) + old_subject = issue.subject + new_subject = 'Subject modified by IssuesControllerTest#test_post_edit' + + post :edit, :id => 1, :issue => {:subject => new_subject} assert_redirected_to 'issues/show/1' - assert_equal 'Modified subject', Issue.find(1).subject + issue.reload + assert_equal new_subject, issue.subject + + mail = ActionMailer::Base.deliveries.last + assert_kind_of TMail::Mail, mail + assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]") + assert mail.body.include?("Subject changed from #{old_subject} to #{new_subject}") end def test_post_change_status |