diff options
author | José Valim <jose.valim@gmail.com> | 2010-08-02 16:16:02 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-02 16:16:46 +0200 |
commit | b613c3cc7b08b00595e33d1b5302cd5d42687d4e (patch) | |
tree | cda1281eb979fc0a81407a384c71c6da58291dce /activerecord/test/cases | |
parent | 311ea94f73c95be87f9a474da122719eebee3f98 (diff) | |
download | rails-b613c3cc7b08b00595e33d1b5302cd5d42687d4e.tar.gz rails-b613c3cc7b08b00595e33d1b5302cd5d42687d4e.tar.bz2 rails-b613c3cc7b08b00595e33d1b5302cd5d42687d4e.zip |
Add an internal (private API) after_touch callback. [#5271 state:resolved]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/timestamp_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index e3d12f6214..06ab7aa9c7 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -2,9 +2,10 @@ require 'cases/helper' require 'models/developer' require 'models/owner' require 'models/pet' +require 'models/toy' class TimestampTest < ActiveRecord::TestCase - fixtures :developers, :owners, :pets + fixtures :developers, :owners, :pets, :toys def setup @developer = Developer.first @@ -91,11 +92,10 @@ class TimestampTest < ActiveRecord::TestCase pet = toy.pet owner = pet.owner - previously_owner_updated_at = owner.updated_at - + owner.update_attribute(:updated_at, (time = 3.days.ago)) toy.touch - assert_not_equal previously_owner_updated_at, owner.updated_at + assert_not_equal time, owner.updated_at ensure Toy.belongs_to :pet end |