diff options
Diffstat (limited to 'activerecord/test/cases/associations/extension_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/extension_test.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/test/cases/associations/extension_test.rb b/activerecord/test/cases/associations/extension_test.rb index da767a2a7e..9d373cd73b 100644 --- a/activerecord/test/cases/associations/extension_test.rb +++ b/activerecord/test/cases/associations/extension_test.rb @@ -3,6 +3,7 @@ require 'models/post' require 'models/comment' require 'models/project' require 'models/developer' +require 'models/computer' require 'models/company_in_module' class AssociationsExtensionsTest < ActiveRecord::TestCase @@ -59,9 +60,11 @@ class AssociationsExtensionsTest < ActiveRecord::TestCase end def test_extension_name - assert_equal 'DeveloperAssociationNameAssociationExtension', extension_name(Developer) - assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', extension_name(MyApplication::Business::Developer) - assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', extension_name(MyApplication::Business::Developer) + extend!(Developer) + extend!(MyApplication::Business::Developer) + + assert Object.const_get 'DeveloperAssociationNameAssociationExtension' + assert MyApplication::Business.const_get 'DeveloperAssociationNameAssociationExtension' end def test_proxy_association_after_scoped @@ -72,9 +75,8 @@ class AssociationsExtensionsTest < ActiveRecord::TestCase private - def extension_name(model) + def extend!(model) builder = ActiveRecord::Associations::Builder::HasMany.new(model, :association_name, nil, {}) { } - builder.send(:wrap_block_extension) - builder.extension_module.name + builder.define_extensions(model) end end |