aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_go_eager_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/associations_go_eager_test.rb')
-rw-r--r--activerecord/test/associations_go_eager_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb
index cd3f0e1f4a..750e8bd208 100644
--- a/activerecord/test/associations_go_eager_test.rb
+++ b/activerecord/test/associations_go_eager_test.rb
@@ -137,11 +137,21 @@ class EagerAssociationTest < Test::Unit::TestCase
def test_eager_with_invalid_association_reference
assert_raises(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
+ post = Post.find(6, :include=> :monkeys )
+ }
+ assert_raises(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
post = Post.find(6, :include=>[ :monkeys ])
}
+ assert_raises(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
+ post = Post.find(6, :include=>[ 'monkeys' ])
+ }
assert_raises(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys, :elephants") {
post = Post.find(6, :include=>[ :monkeys, :elephants ])
}
end
+ def test_eager_with_valid_association_as_string_not_symbol
+ assert_nothing_raised { Post.find(:all, :include => 'comments') }
+ end
+
end