diff options
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 6e47967696..8e5bc56008 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -175,14 +175,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase c = Client.new assert_nil c.firm - if c.firm - assert false, "belongs_to failed if check" - end - - unless c.firm - else - assert false, "belongs_to failed unless check" - end + flunk "belongs_to failed if check" if c.firm end def test_find_ids @@ -620,7 +613,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal [], Client.destroyed_client_ids[firm.id] # Should be destroyed since the association is exclusively dependent. - assert Client.find_by_id(client_id).nil? + assert_nil Client.find_by_id(client_id) end def test_dependent_association_respects_optional_conditions_on_delete @@ -669,7 +662,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase old_record = firm.clients_using_primary_key_with_delete_all.first firm = Firm.find(:first) firm.destroy - assert Client.find_by_id(old_record.id).nil? + assert_nil Client.find_by_id(old_record.id) end def test_creation_respects_hash_condition |