summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-08 08:15:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-08 08:15:52 +0000
commitcf76867a2f4ebf0e894d7e56c438a6309f4fad6c (patch)
tree5a5538d33680f9b17c8e7aa186427c1275539537
parent2f77bfde91846b799d70a436783a8eee2741bf75 (diff)
downloadredmine-cf76867a2f4ebf0e894d7e56c438a6309f4fad6c.tar.gz
redmine-cf76867a2f4ebf0e894d7e56c438a6309f4fad6c.zip
Adds tests for default assignments (#482).
git-svn-id: http://svn.redmine.org/redmine/trunk@16526 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/issue_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 68a2b54c5..53833c631 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -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',