summaryrefslogtreecommitdiffstats
path: root/test/unit/version_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-23 11:31:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-23 11:31:20 +0000
commiteb023bdcce2bd6d9ec3b1d37aa09e436c5ee8149 (patch)
tree352efa51b7e99d469ac3121eb531b58715609b30 /test/unit/version_test.rb
parentf94711ea8c9998a6a6af74370fdc02c9c25208cb (diff)
downloadredmine-eb023bdcce2bd6d9ec3b1d37aa09e436c5ee8149.tar.gz
redmine-eb023bdcce2bd6d9ec3b1d37aa09e436c5ee8149.zip
Add option to set a new version as default directly from New Version page (#24011).
git-svn-id: http://svn.redmine.org/redmine/trunk@15922 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/version_test.rb')
-rw-r--r--test/unit/version_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb
index 56adc3c4a..470207be2 100644
--- a/test/unit/version_test.rb
+++ b/test/unit/version_test.rb
@@ -29,6 +29,22 @@ class VersionTest < ActiveSupport::TestCase
assert_equal 'none', v.sharing
end
+ def test_create_as_default_project_version
+ project = Project.find(1)
+ v = Version.new(:project => project, :name => '1.1',
+ :default_project_version => '1')
+ assert v.save
+ assert_equal v, project.reload.default_version
+ end
+
+ def test_create_not_as_default_project_version
+ project = Project.find(1)
+ v = Version.new(:project => project, :name => '1.1',
+ :default_project_version => '0')
+ assert v.save
+ assert_nil project.reload.default_version
+ end
+
def test_invalid_effective_date_validation
v = Version.new(:project => Project.find(1), :name => '1.1',
:effective_date => '99999-01-01')