diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-08-24 09:56:26 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-24 11:24:32 -0300 |
commit | 747e0744dd61561c27ae1b65a74a2b7da7e3f2fe (patch) | |
tree | cdd5e57a28cdfae79d605437e9ac0c3c5c372c8c /activerecord/test | |
parent | 11f6179f55d38dd54b69aeeb5bee9053194f0e84 (diff) | |
download | rails-747e0744dd61561c27ae1b65a74a2b7da7e3f2fe.tar.gz rails-747e0744dd61561c27ae1b65a74a2b7da7e3f2fe.tar.bz2 rails-747e0744dd61561c27ae1b65a74a2b7da7e3f2fe.zip |
@user.touch should not fail if User does not have updated_at/updated_on column.
[#5439 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/timestamp_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index dea93b38dd..db7accfc40 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -3,13 +3,15 @@ require 'models/developer' require 'models/owner' require 'models/pet' require 'models/toy' +require 'models/car' class TimestampTest < ActiveRecord::TestCase - fixtures :developers, :owners, :pets, :toys + fixtures :developers, :owners, :pets, :toys, :cars def setup @developer = Developer.first @previously_updated_at = @developer.updated_at + @car = Car.first end def test_saving_a_changed_record_updates_its_timestamp @@ -58,6 +60,10 @@ class TimestampTest < ActiveRecord::TestCase assert_not_equal @previously_updated_at, @developer.updated_at end + def test_touch_a_record_without_timestamps + assert_nothing_raised { @car.touch } + end + def test_saving_a_record_with_a_belongs_to_that_specifies_touching_the_parent_should_update_the_parent_updated_at pet = Pet.first owner = pet.owner |