aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-06-25 14:23:06 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-06-25 14:23:06 +0200
commit5f5e6d924973003c105feb711cefdb726f312768 (patch)
treef446c5c65643c64b3afed0fd7367d9faecd9eeac /activerecord/test/cases
parent41568f8c0781d6435dc3acf08bb12b00981dc4bb (diff)
downloadrails-5f5e6d924973003c105feb711cefdb726f312768.tar.gz
rails-5f5e6d924973003c105feb711cefdb726f312768.tar.bz2
rails-5f5e6d924973003c105feb711cefdb726f312768.zip
Add pending test for the great-grandparent touching bug from #19324
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/touch_later_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/activerecord/test/cases/touch_later_test.rb b/activerecord/test/cases/touch_later_test.rb
index 11804ff90b..49ada22529 100644
--- a/activerecord/test/cases/touch_later_test.rb
+++ b/activerecord/test/cases/touch_later_test.rb
@@ -2,8 +2,11 @@ require 'cases/helper'
require 'models/invoice'
require 'models/line_item'
require 'models/topic'
+require 'models/node'
+require 'models/tree'
class TouchLaterTest < ActiveRecord::TestCase
+ fixtures :nodes, :trees
def test_touch_laster_raise_if_non_persisted
invoice = Invoice.new
@@ -90,4 +93,22 @@ class TouchLaterTest < ActiveRecord::TestCase
invoice.touch_later
end
end
+
+ def test_touching_three_deep
+ skip "Pending from #19324"
+
+ previous_tree_updated_at = trees(:root).updated_at
+ previous_grandparent_updated_at = nodes(:grandparent).updated_at
+ previous_parent_updated_at = nodes(:parent_a).updated_at
+ previous_child_updated_at = nodes(:child_one_of_a).updated_at
+
+ travel 5.seconds
+
+ Node.create! parent: nodes(:child_one_of_a), tree: trees(:root)
+
+ assert_not_equal nodes(:child_one_of_a).reload.updated_at, previous_child_updated_at
+ assert_not_equal nodes(:parent_a).reload.updated_at, previous_parent_updated_at
+ assert_not_equal nodes(:grandparent).reload.updated_at, previous_grandparent_updated_at
+ assert_not_equal trees(:root).reload.updated_at, previous_tree_updated_at
+ end
end