Project

General

Profile

Feature #17699 » email_from_parens_format_test.diff

Stanislav German-Evtushenko, 2014-08-18 12:53

View differences:

test/unit/mail_handler_test.rb (working copy)
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!
test/fixtures/mail_handler/ticket_by_unknown_user_parentheses.eml (revision 0)
Return-Path: <john.doe@somenet.foo>
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: <redmine@somenet.foo>
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.
(2-2/6)