mirror of https://github.com/rails/rails
Fix dodgy tests which were effectively asserting nil == nil
This commit is contained in:
parent
7021b6b851
commit
f2230c06ed
|
@ -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
|
||||
|
|
|
@ -13,6 +13,7 @@ first_firm:
|
|||
type: Firm
|
||||
name: 37signals
|
||||
ruby_type: Firm
|
||||
firm_id: 1
|
||||
|
||||
second_client:
|
||||
id: 3
|
||||
|
|
Loading…
Reference in New Issue