Index: test/unit/mail_handler_test.rb =================================================================== --- test/unit/mail_handler_test.rb (revision 12902) +++ test/unit/mail_handler_test.rb (working copy) @@ -304,6 +304,30 @@ end end + def test_add_issue_by_created_user_parentheses + Setting.default_language = 'en' + assert_difference 'User.count' do + issue = submit_email( + 'ticket_by_unknown_user_parentheses.eml', + :issue => {:project => 'ecookbook'}, + :unknown_user => 'create' + ) + assert issue.is_a?(Issue) + assert issue.author.active? + assert_equal 'john.doe@somenet.foo', issue.author.mail + assert_equal 'John', issue.author.firstname + assert_equal 'Doe', issue.author.lastname + + # account information + email = ActionMailer::Base.deliveries.first + assert_not_nil email + assert email.subject.include?('account activation') + login = mail_body(email).match(/\* Login: (.*)$/)[1].strip + password = mail_body(email).match(/\* Password: (.*)$/)[1].strip + assert_equal issue.author, User.try_to_login(login, password) + end + end + def test_created_user_should_be_added_to_groups group1 = Group.generate! group2 = Group.generate! Index: test/fixtures/mail_handler/ticket_by_unknown_user_parentheses.eml =================================================================== --- test/fixtures/mail_handler/ticket_by_unknown_user_parentheses.eml (revision 0) +++ test/fixtures/mail_handler/ticket_by_unknown_user_parentheses.eml (revision 0) @@ -0,0 +1,18 @@ +Return-Path: +Received: from osiris ([127.0.0.1]) + by OSIRIS + with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200 +Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris> +From: john.doe@somenet.foo (John Doe) +To: +Subject: Ticket by unknown user +Date: Sun, 22 Jun 2008 12:28:07 +0200 +MIME-Version: 1.0 +Content-Type: text/plain; + format=flowed; + charset="iso-8859-1"; + reply-type=original +Content-Transfer-Encoding: 7bit + +This is a ticket submitted by an unknown user. +