aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Arnold <evan.arnold@gmail.com>2012-06-01 12:09:33 -0700
committerkennyj <kennyj@gmail.com>2012-06-04 18:35:08 +0900
commitcfc7f602bfab90d78828f50961dbaa1daf64a352 (patch)
treea5e2713259e8b9c0cb02a65ded32ed1cf60132c2
parentd10eb699649f9d7fa7e51ae1b633545d6a55e1ad (diff)
downloadrails-cfc7f602bfab90d78828f50961dbaa1daf64a352.tar.gz
rails-cfc7f602bfab90d78828f50961dbaa1daf64a352.tar.bz2
rails-cfc7f602bfab90d78828f50961dbaa1daf64a352.zip
Add failing test for 3.2.5 datetime attribute regression
-rw-r--r--activerecord/test/cases/dirty_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index 2650040a80..46d485135f 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -78,6 +78,17 @@ class DirtyTest < ActiveRecord::TestCase
assert_equal old_created_on, pirate.created_on_was
end
end
+
+ def test_setting_time_attributes_with_time_zone_field_to_itself_should_not_be_marked_as_a_change
+ in_time_zone 'Paris' do
+ target = Class.new(ActiveRecord::Base)
+ target.table_name = 'pirates'
+
+ pirate = target.create
+ pirate.created_on = pirate.created_on
+ assert !pirate.created_on_changed?
+ end
+ end
def test_time_attributes_changes_without_time_zone_by_skip
in_time_zone 'Paris' do