aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/finder_test.rb
diff options
context:
space:
mode:
authorEgor Lynko <flexoid@gmail.com>2012-05-30 00:36:28 +0300
committerEgor Lynko <flexoid@gmail.com>2012-06-25 18:30:15 +0300
commit359592bba6cb85b43ca8945917b1ca57fa7494a9 (patch)
tree215a7c8cd7c1074b0d8b6e64ece9785e89b854bd /activerecord/test/cases/finder_test.rb
parent24a4cc741a948cd4a01d172a3bfbd68c509b4448 (diff)
downloadrails-359592bba6cb85b43ca8945917b1ca57fa7494a9.tar.gz
rails-359592bba6cb85b43ca8945917b1ca57fa7494a9.tar.bz2
rails-359592bba6cb85b43ca8945917b1ca57fa7494a9.zip
exists?(false) returns false
`FinderMethods#exists?` finder method now returns *false* with the *false* argument
Diffstat (limited to 'activerecord/test/cases/finder_test.rb')
-rw-r--r--activerecord/test/cases/finder_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index e62d984ebd..576a455f09 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -55,6 +55,10 @@ class FinderTest < ActiveRecord::TestCase
assert Topic.exists?
end
+ def test_exists_returns_false_with_false_arg
+ assert !Topic.exists?(false)
+ end
+
# exists? should handle nil for id's that come from URLs and always return false
# (example: Topic.exists?(params[:id])) where params[:id] is nil
def test_exists_with_nil_arg