diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index fce27d8972171fc4750adf47bc439663ffe1c7b2..dea93b38ddca2b9e22d1a1013d98460124d446b4 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -38,6 +38,16 @@ def test_touching_a_record_updates_its_timestamp 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)