From 36344be45e2731a05e20db74d91cebbd51f095b5 Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Tue, 24 Aug 2010 15:20:02 +0200 Subject: [PATCH] Add test case for ActiveRecord::Base.record_timestamps = false This is a failing test case for Lighthouse ticket #5440: https://rails.lighthouseapp.com/projects/8994/tickets/5440 --- activerecord/test/cases/timestamp_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index bf23b47..e369fa3 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -38,6 +38,16 @@ class TimestampTest < ActiveRecord::TestCase assert_equal previous_salary, @developer.salary end + def test_saving_when_record_timestamps_is_false_doesnt_update_its_timestamp + Developer.record_timestamps = false + @developer.name = "John Smith" + @developer.save! + + assert_equal @previously_updated_at, @developer.updated_at + ensure + Developer.record_timestamps = true + end + def test_touching_a_different_attribute previously_created_at = @developer.created_at @developer.touch(:created_at) -- 1.7.2.2