aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-10-06 22:21:10 +0000
committerMarcel Molina <marcel@vernix.org>2005-10-06 22:21:10 +0000
commite8b427cdefd9ec851e2853d4bf21dd8fd676096d (patch)
tree7aae75a60ff2fb3dfa62dbcedd21d4d216684abf /activerecord/test/finder_test.rb
parentbcb50f3c893e070caa3abf06bee03885f1601190 (diff)
downloadrails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.tar.gz
rails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.tar.bz2
rails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.zip
Raise an exception when invalid options are passed to ActiveRecord::Base.find. Closes #2363.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rw-r--r--activerecord/test/finder_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index c87fc7f2f2..d40c1272f1 100644
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -276,6 +276,11 @@ class FinderTest < Test::Unit::TestCase
assert_raises(ActiveRecord::StatementInvalid) { Topic.find_by_sql "select 1 from badtable" }
end
+ def test_find_with_invalid_params
+ assert_raises(ArgumentError) { Topic.find :first, :join => "It should be `joins'" }
+ assert_raises(ArgumentError) { Topic.find :first, :conditions => '1 = 1', :join => "It should be `joins'" }
+ end
+
def test_find_all_with_limit
first_five_developers = Developer.find :all, :order => 'id ASC', :limit => 5
assert_equal 5, first_five_developers.length