aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/timestamp_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/timestamp_test.rb')
-rw-r--r--activerecord/test/cases/timestamp_test.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index 6f983bce75..0c13bb946a 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -176,7 +176,7 @@ class TimestampTest < ActiveRecord::TestCase
assert_not_equal time, owner.updated_at
end
- def test_changing_parent_of_a_record_touches_both_new_and_old_parent_record_and_grandparent_record
+ def test_changing_parent_of_a_record_touches_both_new_and_old_parent_record
klass = Class.new(ActiveRecord::Base) do
def self.name; 'Toy'; end
belongs_to :pet, touch: true
@@ -184,30 +184,22 @@ class TimestampTest < ActiveRecord::TestCase
toy1 = klass.find(1)
old_pet = toy1.pet
- old_owner = old_pet.owner
toy2 = klass.find(2)
new_pet = toy2.pet
- new_owner = new_pet.owner
time = 3.days.ago
old_pet.update_columns(updated_at: time)
- old_owner.update_columns(updated_at: time)
new_pet.update_columns(updated_at: time)
- new_owner.update_columns(updated_at: time)
toy1.pet = new_pet
toy1.save!
old_pet.reload
- old_owner.reload
new_pet.reload
- new_owner.reload
- assert_not_equal time, old_pet.updated_at
- assert_not_equal time, old_owner.updated_at
assert_not_equal time, new_pet.updated_at
- assert_not_equal time, new_owner.updated_at
+ assert_not_equal time, old_pet.updated_at
end
def test_timestamp_attributes_for_create