diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 20:01:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 20:01:05 +0000 |
commit | 91da86a688c27d13c373861901efffc2ec1ddbf1 (patch) | |
tree | 0d1d44f8668661b1657c3f75efae89cdb6ab3e05 /test/unit/mail_handler_test.rb | |
parent | 9110b543b518d2592df583b4fe1d824a0a0871a8 (diff) | |
download | redmine-91da86a688c27d13c373861901efffc2ec1ddbf1.tar.gz redmine-91da86a688c27d13c373861901efffc2ec1ddbf1.zip |
Add watchers from To and Cc fields in issue replies (#7017).
git-svn-id: http://svn.redmine.org/redmine/trunk@15092 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r-- | test/unit/mail_handler_test.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index e2522db26..47e642e91 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -265,7 +265,7 @@ class MailHandlerTest < ActiveSupport::TestCase end end - def test_add_issue_with_cc + def test_add_issue_should_add_cc_as_watchers issue = submit_email('ticket_with_cc.eml', :issue => {:project => 'ecookbook'}) assert issue.is_a?(Issue) assert !issue.new_record? @@ -813,6 +813,28 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal 'Normal', journal.issue.priority.name end + def test_update_issue_should_add_cc_as_watchers + Watcher.delete_all + issue = Issue.find(2) + + assert_difference 'Watcher.count' do + assert submit_email('issue_update_with_cc.eml') + end + issue.reload + assert_equal 1, issue.watcher_user_ids.size + assert issue.watched_by?(User.find_by_mail('dlopper@somenet.foo')) + end + + def test_update_issue_should_not_add_cc_as_watchers_if_already_watching + Watcher.delete_all + issue = Issue.find(2) + Watcher.create!(:watchable => issue, :user => User.find_by_mail('dlopper@somenet.foo')) + + assert_no_difference 'Watcher.count' do + assert submit_email('issue_update_with_cc.eml') + end + end + def test_replying_to_a_private_note_should_add_reply_as_private private_journal = Journal.create!(:notes => 'Private notes', :journalized => Issue.find(1), :private_notes => true, :user_id => 2) |