aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorAdeh DeSandies <adeh@yahoo.com>2008-09-12 18:02:40 +0800
committerrick <technoweenie@gmail.com>2008-09-20 13:46:09 -0700
commitde96a8666d8edc9be57f6146e587a71d23dbeb41 (patch)
tree641cb4fe91bab52207dc25ba16e91006c0044655 /activerecord/test/cases
parent22e830f883af0b56de81186c184751b6398d0141 (diff)
downloadrails-de96a8666d8edc9be57f6146e587a71d23dbeb41.tar.gz
rails-de96a8666d8edc9be57f6146e587a71d23dbeb41.tar.bz2
rails-de96a8666d8edc9be57f6146e587a71d23dbeb41.zip
applied patch to fix the associations with blocks in modules bug from an old trac ticket
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/extension_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/extension_test.rb b/activerecord/test/cases/associations/extension_test.rb
index 5c01c3c1f5..9390633d5b 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/company_in_module'
class AssociationsExtensionsTest < ActiveRecord::TestCase
fixtures :projects, :developers, :developers_projects, :comments, :posts
@@ -44,4 +45,18 @@ class AssociationsExtensionsTest < ActiveRecord::TestCase
david = Marshal.load(Marshal.dump(david))
assert_equal projects(:action_controller), david.projects_extended_by_name.find_most_recent
end
+
+
+ def test_extension_name
+ extension = Proc.new {}
+ name = :association_name
+
+ assert_equal 'DeveloperAssociationNameAssociationExtension', Developer.send(:create_extension_modules, name, extension, []).first.name
+ assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension',
+MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name
+ assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name
+ assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name
+ end
+
+
end