mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 08:16:03 +01:00
Adds tests for default assignments (#482).
git-svn-id: http://svn.redmine.org/redmine/trunk@16526 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -609,6 +609,22 @@ class IssueTest < ActiveSupport::TestCase
|
||||
assert_equal version, issue.fixed_version
|
||||
end
|
||||
|
||||
def test_default_assigned_to_based_on_category_should_be_set_on_create
|
||||
user = User.find(3)
|
||||
category = IssueCategory.create!(:project_id => 1, :name => 'With default assignee', :assigned_to_id => 3)
|
||||
|
||||
issue = Issue.generate!(:project_id => 1, :category_id => category.id)
|
||||
assert_equal user, issue.assigned_to
|
||||
end
|
||||
|
||||
def test_default_assigned_to_based_on_project_should_be_set_on_create
|
||||
user = User.find(3)
|
||||
Project.find(1).update!(:default_assigned_to_id => user.id)
|
||||
|
||||
issue = Issue.generate!(:project_id => 1)
|
||||
assert_equal user, issue.assigned_to
|
||||
end
|
||||
|
||||
def test_should_not_update_custom_fields_on_changing_tracker_with_different_custom_fields
|
||||
issue = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1,
|
||||
:status_id => 1, :subject => 'Test',
|
||||
|
||||
Reference in New Issue
Block a user