aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorMatt Ganderup <matt.ganderup@gmail.com>2009-06-01 10:24:15 -0700
committerGeoff Buesing <gbuesing@gmail.com>2009-08-03 22:41:56 -0500
commit55d1d12c32a1b99f3f07d2346b49a63650ba2e9d (patch)
treeeb639136792af6af332cbc134f5ebbdaa5e6a435 /activerecord/test/cases
parent6f97ad07ded847f29159baf71050c63f04282170 (diff)
downloadrails-55d1d12c32a1b99f3f07d2346b49a63650ba2e9d.tar.gz
rails-55d1d12c32a1b99f3f07d2346b49a63650ba2e9d.tar.bz2
rails-55d1d12c32a1b99f3f07d2346b49a63650ba2e9d.zip
fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years [#2019 state:resolved]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/date_time_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/date_time_test.rb b/activerecord/test/cases/date_time_test.rb
index 36e1caa0b6..f7527c0c04 100644
--- a/activerecord/test/cases/date_time_test.rb
+++ b/activerecord/test/cases/date_time_test.rb
@@ -34,4 +34,10 @@ class DateTimeTest < ActiveRecord::TestCase
topic.bonus_time = ''
assert_nil topic.bonus_time
end
+
+ def test_two_digit_year
+ topic = Topic.new
+ topic.last_read = '1/1/09'
+ assert_equal Date.new(2009,1,1), topic.last_read
+ end
end