aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/timestamp_test.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-05-19 15:14:51 -0400
committerJosé Valim <jose.valim@gmail.com>2010-05-19 21:31:51 +0200
commit39a246f545a714b21c669e2f6eda4012526c3874 (patch)
tree89da32733821f0a7dcc56efdac82c72897eca424 /activerecord/test/cases/timestamp_test.rb
parentbdb2871df7fb0a1eeceadb31aaba4d160df508aa (diff)
downloadrails-39a246f545a714b21c669e2f6eda4012526c3874.tar.gz
rails-39a246f545a714b21c669e2f6eda4012526c3874.tar.bz2
rails-39a246f545a714b21c669e2f6eda4012526c3874.zip
Final iteration of use better testing methods
[#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/timestamp_test.rb')
-rw-r--r--activerecord/test/cases/timestamp_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index 24b237a72b..549c4af6b1 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -15,26 +15,26 @@ class TimestampTest < ActiveRecord::TestCase
@developer.name = "Jack Bauer"
@developer.save!
- assert @previously_updated_at != @developer.updated_at
+ assert_not_equal @previously_updated_at, @developer.updated_at
end
def test_saving_a_unchanged_record_doesnt_update_its_timestamp
@developer.save!
- assert @previously_updated_at == @developer.updated_at
+ assert_equal @previously_updated_at, @developer.updated_at
end
def test_touching_a_record_updates_its_timestamp
@developer.touch
- assert @previously_updated_at != @developer.updated_at
+ assert_not_equal @previously_updated_at, @developer.updated_at
end
def test_touching_a_different_attribute
previously_created_at = @developer.created_at
@developer.touch(:created_at)
- assert previously_created_at != @developer.created_at
+ assert_not_equal previously_created_at, @developer.created_at
end
def test_saving_a_record_with_a_belongs_to_that_specifies_touching_the_parent_should_update_the_parent_updated_at
@@ -45,7 +45,7 @@ class TimestampTest < ActiveRecord::TestCase
pet.name = "Fluffy the Third"
pet.save
- assert previously_owner_updated_at != pet.owner.updated_at
+ assert_not_equal previously_owner_updated_at, pet.owner.updated_at
end
def test_destroying_a_record_with_a_belongs_to_that_specifies_touching_the_parent_should_update_the_parent_updated_at
@@ -55,7 +55,7 @@ class TimestampTest < ActiveRecord::TestCase
pet.destroy
- assert previously_owner_updated_at != pet.owner.updated_at
+ assert_not_equal previously_owner_updated_at, pet.owner.updated_at
end
def test_saving_a_record_with_a_belongs_to_that_specifies_touching_a_specific_attribute_the_parent_should_update_that_attribute
@@ -68,8 +68,8 @@ class TimestampTest < ActiveRecord::TestCase
pet.name = "Fluffy the Third"
pet.save
- assert previously_owner_happy_at != pet.owner.happy_at
+ assert_not_equal previously_owner_happy_at, pet.owner.happy_at
ensure
Pet.belongs_to :owner, :touch => true
end
-end \ No newline at end of file
+end