aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rwxr-xr-xactiverecord/test/finder_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index 30b0b78313..a5eaca039e 100755
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -233,6 +233,10 @@ class FinderTest < Test::Unit::TestCase
assert_equal "Mary", topics[0].author_name
end
+ def test_find_with_bad_sql
+ assert_raises(ActiveRecord::StatementInvalid) { Topic.find_by_sql "select 1 from badtable" }
+ end
+
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)