summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-05 16:34:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-05 16:34:41 +0000
commit45c93340b78da811d151f16177eeaa59064988f4 (patch)
tree50b6106dfc85cc92daac22db6abc7f171306e4d5 /test
parent3e14c3017c037d93e562c3697cf50224dced7b50 (diff)
downloadredmine-45c93340b78da811d151f16177eeaa59064988f4.tar.gz
redmine-45c93340b78da811d151f16177eeaa59064988f4.zip
Negative estimated hours should not be valid (#12735).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11125 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 1ef94c636..cb89d37a5 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -79,6 +79,15 @@ class IssueTest < ActiveSupport::TestCase
assert_include 'Due date must be greater than start date', issue.errors.full_messages
end
+ def test_estimated_hours_should_be_validated
+ set_language_if_valid 'en'
+ ['-2'].each do |invalid|
+ issue = Issue.new(:estimated_hours => invalid)
+ assert !issue.valid?
+ assert_include 'Estimated time is invalid', issue.errors.full_messages
+ end
+ end
+
def test_create_with_required_custom_field
set_language_if_valid 'en'
field = IssueCustomField.find_by_name('Database')