aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/timestamp_test.rb
diff options
context:
space:
mode:
authorDmitriy Kiriyenko <dmitriy.kiriyenko@gmail.com>2011-06-06 10:30:05 +0300
committerJon Leighton <j@jonathanleighton.com>2011-06-07 18:42:40 +0100
commit7c1f73c843310a3dd0cee179f56ffdc7c859eaa0 (patch)
treeeac2cb33112b2a5f02172b138481dc3817f7e3cd /activerecord/test/cases/timestamp_test.rb
parent050d6ef060464427ae4ea559224c7040da268d5b (diff)
downloadrails-7c1f73c843310a3dd0cee179f56ffdc7c859eaa0.tar.gz
rails-7c1f73c843310a3dd0cee179f56ffdc7c859eaa0.tar.bz2
rails-7c1f73c843310a3dd0cee179f56ffdc7c859eaa0.zip
Do not use default_scope in ActiveRecord::Persistence#touch.
Diffstat (limited to 'activerecord/test/cases/timestamp_test.rb')
-rw-r--r--activerecord/test/cases/timestamp_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index ceb1452afd..c0f1b5895e 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -40,6 +40,15 @@ class TimestampTest < ActiveRecord::TestCase
assert_equal previous_salary, @developer.salary
end
+ def test_touching_a_record_with_default_scope_that_exludes_it_updates_its_timestamp
+ developer = @developer.becomes(DeveloperCalledJamis)
+
+ developer.touch
+ assert_not_equal @previously_updated_at, developer.updated_at
+ developer.reload
+ assert_not_equal @previously_updated_at, developer.updated_at
+ end
+
def test_saving_when_record_timestamps_is_false_doesnt_update_its_timestamp
Developer.record_timestamps = false
@developer.name = "John Smith"