diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-10-16 23:17:49 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-10-16 23:17:49 +0200 |
commit | 95c609357e78106e9673931d3f60d8ff3cc0a0cd (patch) | |
tree | 82f682f2129f41e6829ef17aeb899843f11c3e71 /activerecord/test/cases/associations | |
parent | 9cb5400871b660e2c6d1654346650f07bb52a0c0 (diff) | |
download | rails-95c609357e78106e9673931d3f60d8ff3cc0a0cd.tar.gz rails-95c609357e78106e9673931d3f60d8ff3cc0a0cd.tar.bz2 rails-95c609357e78106e9673931d3f60d8ff3cc0a0cd.zip |
Ensure association proxy responds to private class methods defined in associated class. [#1083]
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index dada2d1603..8d97b30c74 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1081,8 +1081,14 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end def test_sending_new_to_association_proxy_should_have_same_effect_as_calling_new - clients_assoc = companies(:first_firm).clients - assert_equal clients_assoc.new.attributes, clients_assoc.send(:new).attributes + client_association = companies(:first_firm).clients + assert_equal client_association.new.attributes, client_association.send(:new).attributes + end + + def test_respond_to_private_class_methods + client_association = companies(:first_firm).clients + assert !client_association.respond_to?(:private_method) + assert client_association.respond_to?(:private_method, true) end end |