summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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,