summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-09 09:11:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-09 09:11:44 +0000
commita18db94c06b74dd0787da312627a66464078a40f (patch)
treecbe28e3181184ccb78e2bb2f9eb5b61ffad96d96 /test/unit
parentfe3a4cdbd18153ac6ca83bc9c947e879ee7927b6 (diff)
downloadredmine-a18db94c06b74dd0787da312627a66464078a40f.tar.gz
redmine-a18db94c06b74dd0787da312627a66464078a40f.zip
Merged r11472 from trunk (#3107).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11562 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/time_entry_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/time_entry_test.rb b/test/unit/time_entry_test.rb
index cb6d37d54..b14e799ce 100644
--- a/test/unit/time_entry_test.rb
+++ b/test/unit/time_entry_test.rb
@@ -110,6 +110,13 @@ class TimeEntryTest < ActiveSupport::TestCase
assert_equal 1, te.errors.count
end
+ def test_spent_on_with_2_digits_year_should_not_be_valid
+ entry = TimeEntry.new(:project => Project.find(1), :user => User.find(1), :activity => TimeEntryActivity.first, :hours => 1)
+ entry.spent_on = "09-02-04"
+ assert !entry.valid?
+ assert_include I18n.translate('activerecord.errors.messages.not_a_date'), entry.errors[:spent_on]
+ end
+
def test_set_project_if_nil
anon = User.anonymous
project = Project.find(1)