summaryrefslogtreecommitdiffstats
path: root/test/unit/mail_handler_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-23 18:18:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-23 18:18:13 +0000
commit578fdc62f26c23951b2d2c2b9be0040c7ade0634 (patch)
tree7f78426f78bdc325cae50368cc1bc3e23f4c5eaa /test/unit/mail_handler_test.rb
parente1832f25c9aa16f1a95434adc209ee937110228a (diff)
downloadredmine-578fdc62f26c23951b2d2c2b9be0040c7ade0634.tar.gz
redmine-578fdc62f26c23951b2d2c2b9be0040c7ade0634.zip
Ability to assign issues to groups (#2964).
Option is disabled by default. It can be turned on in application settings. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6306 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r--test/unit/mail_handler_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 2ead03935..d272e6090 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -109,6 +109,18 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal 'Urgent', issue.priority.to_s
assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
end
+
+ def test_add_issue_with_group_assignment
+ with_settings :issue_group_assignment => '1' do
+ issue = submit_email('ticket_on_given_project.eml') do |email|
+ email.gsub!('Assigned to: John Smith', 'Assigned to: B Team')
+ end
+ assert issue.is_a?(Issue)
+ assert !issue.new_record?
+ issue.reload
+ assert_equal Group.find(11), issue.assigned_to
+ end
+ end
def test_add_issue_with_partial_attributes_override
issue = submit_email('ticket_with_attributes.eml', :issue => {:priority => 'High'}, :allow_override => ['tracker'])
@@ -446,6 +458,7 @@ class MailHandlerTest < ActiveSupport::TestCase
def submit_email(filename, options={})
raw = IO.read(File.join(FIXTURES_PATH, filename))
+ yield raw if block_given?
MailHandler.receive(raw, options)
end