Fix faulty tests introduced in 8d0b4fa39
This commit is contained in:
parent
6cba97d2a4
commit
6277fd9113
@ -26,7 +26,7 @@ def test_has_one_cache_nils
|
|||||||
|
|
||||||
def test_with_select
|
def test_with_select
|
||||||
assert_equal Firm.find(1).account_with_select.attributes.size, 2
|
assert_equal Firm.find(1).account_with_select.attributes.size, 2
|
||||||
assert_equal Firm.find(1, :include => :account_with_select).attributes.size, 2
|
assert_equal Firm.find(1, :include => :account_with_select).account_with_select.attributes.size, 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_can_marshal_has_one_association_with_nil_target
|
def test_can_marshal_has_one_association_with_nil_target
|
||||||
|
@ -159,9 +159,10 @@ def test_association_reflection_in_modules
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_reflection_of_all_associations
|
def test_reflection_of_all_associations
|
||||||
assert_equal 19, Firm.reflect_on_all_associations.size
|
# FIXME these assertions bust a lot
|
||||||
|
assert_equal 20, Firm.reflect_on_all_associations.size
|
||||||
assert_equal 16, Firm.reflect_on_all_associations(:has_many).size
|
assert_equal 16, Firm.reflect_on_all_associations(:has_many).size
|
||||||
assert_equal 3, Firm.reflect_on_all_associations(:has_one).size
|
assert_equal 4, Firm.reflect_on_all_associations(:has_one).size
|
||||||
assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
|
assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class Firm < Company
|
|||||||
has_many :readonly_clients, :class_name => 'Client', :readonly => true
|
has_many :readonly_clients, :class_name => 'Client', :readonly => true
|
||||||
|
|
||||||
has_one :account, :foreign_key => "firm_id", :dependent => :destroy
|
has_one :account, :foreign_key => "firm_id", :dependent => :destroy
|
||||||
has_one :account_with_select, :foreign_key => "firm_id", :select => "id, firm_id"
|
has_one :account_with_select, :foreign_key => "firm_id", :select => "id, firm_id", :class_name=>'Account'
|
||||||
has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true
|
has_one :readonly_account, :foreign_key => "firm_id", :class_name => "Account", :readonly => true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user