397 |
397 |
end
|
398 |
398 |
end
|
399 |
399 |
end
|
|
400 |
|
|
401 |
# Defect #11552, users with dashes in their names cannot be assigned to using their full name.
|
|
402 |
def test_assign_to_user_with_dash_in_name
|
|
403 |
# Create the reported user "IS - Operations"
|
|
404 |
created_user = User.new(:mail => 'dashtest@somenet.foo',
|
|
405 |
:firstname => 'IS -',
|
|
406 |
:lastname => 'Operations')
|
|
407 |
created_user.login = 'dashtest'
|
|
408 |
created_user.save!
|
|
409 |
|
|
410 |
# Add user to project.
|
|
411 |
project = Project.find_by_identifier('ecookbook')
|
|
412 |
assert_not_nil project
|
|
413 |
member = Member.create(:project => project, :user => created_user, :role_ids => [1, 2])
|
|
414 |
|
|
415 |
# Confirm the user got added correctly.
|
|
416 |
get_user = User.find_by_login('dashtest')
|
|
417 |
assert_not_nil get_user
|
|
418 |
assert_equal 'IS -', get_user.firstname
|
|
419 |
|
|
420 |
# Bring in an anonymous e-mail, assigned to IS - Operations.
|
|
421 |
issue = submit_email('ticket_assign_user_with_dash_in_name.eml',
|
|
422 |
:allow_override => 'assigned_to',
|
|
423 |
:issue => { :project => 'ecookbook' },
|
|
424 |
:no_permission_check => '1',
|
|
425 |
:unknown_user => 'accept')
|
|
426 |
assert issue.is_a?(Issue)
|
|
427 |
assert !issue.new_record?
|
|
428 |
issue.save!
|
|
429 |
|
|
430 |
# Reload and check and make sure the user is there.
|
|
431 |
issue.reload
|
|
432 |
assert_equal get_user, issue.assigned_to
|
|
433 |
end
|
400 |
434 |
|
401 |
435 |
def test_add_issue_should_send_email_notification
|
402 |
436 |
Setting.notified_events = ['issue_added']
|