From b4629528866446aa59f663a1162edbdacee85600 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 18 May 2010 21:47:24 -0400 Subject: Use better assertion methods for testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4645 state:resolved] Signed-off-by: José Valim --- activerecord/test/cases/associations/has_one_associations_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/test/cases/associations/has_one_associations_test.rb') diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb index 8f5540950e..469a21b9bf 100644 --- a/activerecord/test/cases/associations/has_one_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_associations_test.rb @@ -149,7 +149,7 @@ class HasOneAssociationsTest < ActiveRecord::TestCase num_accounts = Account.count firm = Firm.find(1) - assert !firm.account.nil? + assert_not_nil firm.account account_id = firm.account.id assert_equal [], Account.destroyed_account_ids[firm.id] @@ -162,7 +162,7 @@ class HasOneAssociationsTest < ActiveRecord::TestCase num_accounts = Account.count firm = ExclusivelyDependentFirm.find(9) - assert !firm.account.nil? + assert_not_nil firm.account account_id = firm.account.id assert_equal [], Account.destroyed_account_ids[firm.id] @@ -181,7 +181,7 @@ class HasOneAssociationsTest < ActiveRecord::TestCase firm = RestrictedFirm.new(:name => 'restrict') firm.save! account = firm.create_account(:credit_limit => 10) - assert !firm.account.nil? + assert_not_nil firm.account assert_raise(ActiveRecord::DeleteRestrictionError) { firm.destroy } end @@ -246,7 +246,7 @@ class HasOneAssociationsTest < ActiveRecord::TestCase def test_dependence_with_missing_association Account.destroy_all firm = Firm.find(1) - assert firm.account.nil? + assert_nil firm.account firm.destroy end -- cgit v1.2.3