Fix dodgy tests which were effectively asserting nil == nil

This commit is contained in:
Jon Leighton 2010-12-24 00:14:46 +00:00
parent 7021b6b851
commit f2230c06ed
2 changed files with 4 additions and 3 deletions

View File

@ -886,15 +886,15 @@ class EagerAssociationTest < ActiveRecord::TestCase
end
def test_preload_has_one_using_primary_key
expected = Firm.find(:first).account_using_primary_key
firm = Firm.find :first, :include => :account_using_primary_key
expected = accounts(:signals37)
firm = Firm.find :first, :include => :account_using_primary_key, :order => 'companies.id'
assert_no_queries do
assert_equal expected, firm.account_using_primary_key
end
end
def test_include_has_one_using_primary_key
expected = Firm.find(1).account_using_primary_key
expected = accounts(:signals37)
firm = Firm.find(:all, :include => :account_using_primary_key, :order => 'accounts.id').detect {|f| f.id == 1}
assert_no_queries do
assert_equal expected, firm.account_using_primary_key

View File

@ -13,6 +13,7 @@ first_firm:
type: Firm
name: 37signals
ruby_type: Firm
firm_id: 1
second_client:
id: 3