Permalink
Browse files

Fix dodgy tests which were effectively asserting nil == nil

  • Loading branch information...
1 parent 7021b6b commit f2230c06edf9c1ca72892bbe00e816be1dafa840 @jonleighton jonleighton committed Dec 24, 2010
Showing with 4 additions and 3 deletions.
  1. +3 −3 activerecord/test/cases/associations/eager_test.rb
  2. +1 −0 activerecord/test/fixtures/companies.yml
@@ -886,15 +886,15 @@ def test_include_has_many_using_primary_key
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

0 comments on commit f2230c0

Please sign in to comment.