diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-15 22:43:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-15 22:43:10 +0000 |
commit | 8b527ce24783acafa0c3148b1c45ea0251fae2d0 (patch) | |
tree | 250bac015e1d02ff44c5c97c144eee7a3bc0cd58 /test | |
parent | e9e5d2e072f6da616149ff643f082fcdef46a222 (diff) | |
download | redmine-8b527ce24783acafa0c3148b1c45ea0251fae2d0.tar.gz redmine-8b527ce24783acafa0c3148b1c45ea0251fae2d0.zip |
Fixed version date validation (#12359).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10810 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/version_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb index 034fa5668..807ff32b7 100644 --- a/test/unit/version_test.rb +++ b/test/unit/version_test.rb @@ -32,7 +32,13 @@ class VersionTest < ActiveSupport::TestCase def test_invalid_effective_date_validation v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01') - assert !v.save + assert !v.valid? + v.effective_date = '2012-11-33' + assert !v.valid? + v.effective_date = '2012-31-11' + assert !v.valid? + v.effective_date = 'ABC' + assert !v.valid? assert_include I18n.translate('activerecord.errors.messages.not_a_date'), v.errors[:effective_date] end |