summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-07 19:34:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-07 19:34:01 +0000
commite9a7d1be6357b8c38091412dc46819c262115cd9 (patch)
treeefcae9cc8f5a27af2dff27f7f6f771f44c95ec5d /test/unit
parent3bb7524c1f282827331a31db3731fc2459d05186 (diff)
downloadredmine-e9a7d1be6357b8c38091412dc46819c262115cd9.tar.gz
redmine-e9a7d1be6357b8c38091412dc46819c262115cd9.zip
Merged r16619 (#26072).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16629 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/issue_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index cf26417e4..4cea06227 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -526,6 +526,18 @@ class IssueTest < ActiveSupport::TestCase
assert_equal version, issue.fixed_version
end
+ def test_default_assigned_to_with_required_assignee_should_validate
+ category = IssueCategory.create!(:project_id => 1, :name => 'With default assignee', :assigned_to_id => 3)
+ Issue.any_instance.stubs(:required_attribute_names).returns(['assigned_to_id'])
+
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'Default')
+ assert !issue.save
+ assert issue.errors['assigned_to_id'].present?
+
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'Default', :category_id => category.id)
+ assert_save issue
+ 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',