summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-06-16 15:13:09 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-06-16 15:13:09 +0000
commit68031b65441c5d6aeb65850ca53f6f914ce53f4c (patch)
tree05afe89a7597762958090d0c294d7d0948ec2895 /test/unit/issue_test.rb
parente5550d5ed45e1cb8a6556b7198ac78de8869c7fe (diff)
downloadredmine-68031b65441c5d6aeb65850ca53f6f914ce53f4c.tar.gz
redmine-68031b65441c5d6aeb65850ca53f6f914ce53f4c.zip
Improved @fixed_version_id@ validation (#37171).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21638 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 0c09ef5e1..f054cee96 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -1650,6 +1650,14 @@ class IssueTest < ActiveSupport::TestCase
assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq
end
+ def test_should_not_be_able_to_set_an_invalid_version_id
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
+ :status_id => 1, :fixed_version_id => 424242,
+ :subject => 'New issue')
+ assert !issue.save
+ assert_not_equal [], issue.errors[:fixed_version_id]
+ end
+
def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
:status_id => 1, :fixed_version_id => 1,