diff options
author | Thiago Pinto <tapgyn@gmail.com> | 2014-03-19 21:13:03 -0400 |
---|---|---|
committer | Thiago Pinto <tapgyn@gmail.com> | 2014-03-19 21:13:03 -0400 |
commit | c80ca4c7803b4e8ed7f125ada9acc6b7c499af5f (patch) | |
tree | dc8c9fa419dc7f4a5fe7b320dab0c4126625c4c5 /activerecord/test | |
parent | 8cea8ae278c0e0417e5d58a387cc5d31c0590251 (diff) | |
download | rails-c80ca4c7803b4e8ed7f125ada9acc6b7c499af5f.tar.gz rails-c80ca4c7803b4e8ed7f125ada9acc6b7c499af5f.tar.bz2 rails-c80ca4c7803b4e8ed7f125ada9acc6b7c499af5f.zip |
ActiveRecord#touch should accept multiple attributes #14423
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/timestamp_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index 717e0e1866..5308fa8808 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -89,6 +89,18 @@ class TimestampTest < ActiveRecord::TestCase assert_in_delta Time.now, task.ending, 1 end + def test_touching_many_attributes_updates_them + task = Task.first + previous_starting = task.starting + previous_ending = task.ending + task.touch(:starting, :ending) + + assert_not_equal previous_starting, task.starting + assert_not_equal previous_ending, task.ending + assert_in_delta Time.now, task.starting, 1 + assert_in_delta Time.now, task.ending, 1 + end + def test_touching_a_record_without_timestamps_is_unexceptional assert_nothing_raised { Car.first.touch } end |