diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-03 07:59:29 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-03 07:59:29 +0000 |
commit | b25d496c246702a72f236e88f5a974282b902fa4 (patch) | |
tree | 0bbe31ff09bd42bcb160687118f7311761b9fcdb /test/unit/mail_handler_test.rb | |
parent | d5ca5146888f01d710091dc5ddb160cf653ffcbd (diff) | |
download | redmine-b25d496c246702a72f236e88f5a974282b902fa4.tar.gz redmine-b25d496c246702a72f236e88f5a974282b902fa4.zip |
Mail handler: adds --default-group option to add created user to one or more groups (#13340).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11522 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r-- | test/unit/mail_handler_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index adb250e56..269ac9da1 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -304,6 +304,22 @@ class MailHandlerTest < ActiveSupport::TestCase end end + def test_created_user_should_be_added_to_groups + group1 = Group.generate! + group2 = Group.generate! + + assert_difference 'User.count' do + submit_email( + 'ticket_by_unknown_user.eml', + :issue => {:project => 'ecookbook'}, + :unknown_user => 'create', + :default_group => "#{group1.name},#{group2.name}" + ) + end + user = User.order('id DESC').first + assert_same_elements [group1, group2], user.groups + end + def test_add_issue_without_from_header Role.anonymous.add_permission!(:add_issues) assert_equal false, submit_email('ticket_without_from_header.eml') |