diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 29a0e8a443..110fb8e4ae 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -92,5 +92,17 @@ class EagerAssociationTest < Test::Unit::TestCase :conditions => ["companies.name = ?", "37signals"]) assert_not_nil companies(:first_firm, :reload).account end + + def test_eager_with_invalid_association_reference + assert_raises(NoMethodError, "Association was not found; perhaps you misspelled it? You specified :include=>:monkeys") { + post = Post.find(6, :include=>[ :monkeys ]) + } + assert_raises(NoMethodError, "Association was not found; perhaps you misspelled it? You specified :include=>:monkeys, :elephants") { + post = Post.find(6, :include=>[ :monkeys, :elephants ]) + } + end + end + + |