From 79d9e0f15522c981fcd1005cec9d441ff96725f5 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 17 Jul 2010 02:35:02 +0800 Subject: Makes this test don't trust on the speed of execution --- activerecord/test/cases/persistence_test.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index fbfdd7b041..4ea5df0945 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -253,14 +253,15 @@ class PersistencesTest < ActiveRecord::TestCase def test_update_attribute_for_udpated_at_on developer = Developer.find(1) - updated_at = developer.updated_at + prev_month = Time.now.prev_month + developer.update_attribute(:updated_at, prev_month) + assert_equal prev_month, developer.updated_at developer.update_attribute(:salary, 80001) - assert_not_equal updated_at, developer.updated_at + assert_not_equal prev_month, developer.updated_at developer.reload - assert_not_equal updated_at, developer.updated_at + assert_not_equal prev_month, developer.updated_at end - def test_update_attributes topic = Topic.find(1) assert !topic.approved? -- cgit v1.2.3