summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-24 06:22:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-24 06:22:55 +0000
commit68620da79ab51c808e6ba1b1cfa496494760ee47 (patch)
tree18dcd8b997417fa7a7174611f8d174e8a87511d9 /test
parentaeab970972dc27791714383e1d27a45afa3f4304 (diff)
downloadredmine-68620da79ab51c808e6ba1b1cfa496494760ee47.tar.gz
redmine-68620da79ab51c808e6ba1b1cfa496494760ee47.zip
Don't require category or target version when they are not available (#20583).
git-svn-id: http://svn.redmine.org/redmine/trunk@14733 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 4b9fbda0b..1da9f71e2 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -926,6 +926,30 @@ class IssueTest < ActiveSupport::TestCase
assert issue.save
end
+ def test_category_should_not_be_required_if_project_has_no_categories
+ Project.find(1).issue_categories.delete_all
+ WorkflowPermission.delete_all
+ WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1,
+ :role_id => 1, :field_name => 'category_id',:rule => 'required')
+ user = User.find(2)
+
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
+ :subject => 'Required fields', :author => user)
+ assert_save issue
+ end
+
+ def test_fixed_version_should_not_be_required_no_assignable_versions
+ Version.delete_all
+ WorkflowPermission.delete_all
+ WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1,
+ :role_id => 1, :field_name => 'fixed_version_id',:rule => 'required')
+ user = User.find(2)
+
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
+ :subject => 'Required fields', :author => user)
+ assert_save issue
+ end
+
def test_required_custom_field_that_is_not_visible_for_the_user_should_not_be_required
CustomField.delete_all
field = IssueCustomField.generate!(:is_required => true, :visible => false, :role_ids => [1], :trackers => Tracker.all, :is_for_all => true)