aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-16 12:57:55 -0300
committerGitHub <noreply@github.com>2016-08-16 12:57:55 -0300
commit149c144409cc9cbc4e960dbd70c9c77d86b06d8d (patch)
tree3cfa2862262417908cea333ca17a12a488810d69 /activerecord/test
parent82ec6b36065e91fe0ec5a87f9419840618ce2c5d (diff)
parented34b6760793ebc8477f3cd6398ac3ef829b57d1 (diff)
downloadrails-149c144409cc9cbc4e960dbd70c9c77d86b06d8d.tar.gz
rails-149c144409cc9cbc4e960dbd70c9c77d86b06d8d.tar.bz2
rails-149c144409cc9cbc4e960dbd70c9c77d86b06d8d.zip
Merge pull request #26183 from Shopify/fix-no-touching-touch-later
Makes touch_later respects no_touching policy
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/touch_later_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/touch_later_test.rb b/activerecord/test/cases/touch_later_test.rb
index 697447a4f3..d1e8c649d9 100644
--- a/activerecord/test/cases/touch_later_test.rb
+++ b/activerecord/test/cases/touch_later_test.rb
@@ -24,6 +24,15 @@ class TouchLaterTest < ActiveRecord::TestCase
assert_not invoice.changed?
end
+ def test_touch_later_respects_no_touching_policy
+ time = Time.now.utc - 25.days
+ topic = Topic.create!(updated_at: time, created_at: time)
+ Topic.no_touching do
+ topic.touch_later
+ end
+ assert_equal time.to_i, topic.updated_at.to_i
+ end
+
def test_touch_later_update_the_attributes
time = Time.now.utc - 25.days
topic = Topic.create!(updated_at: time, created_at: time)