aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index b6ffda8105..d7997beaa3 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -350,6 +350,13 @@ class HasOneAssociationsTest < Test::Unit::TestCase
end
end
+ def test_deprecated_inferred_foreign_key
+ assert_not_deprecated { Company.belongs_to :firm }
+ assert_not_deprecated { Company.belongs_to :client, :foreign_key => "firm_id" }
+ assert_not_deprecated { Company.belongs_to :firm, :class_name => "Firm", :foreign_key => "client_of" }
+ assert_deprecated("inferred foreign_key name") { Company.belongs_to :client, :class_name => "Firm" }
+ end
+
end