diff options
author | Egor Lynko <flexoid@gmail.com> | 2012-05-30 00:36:28 +0300 |
---|---|---|
committer | Egor Lynko <flexoid@gmail.com> | 2012-06-25 18:30:15 +0300 |
commit | 359592bba6cb85b43ca8945917b1ca57fa7494a9 (patch) | |
tree | 215a7c8cd7c1074b0d8b6e64ece9785e89b854bd /activerecord/test/cases/finder_test.rb | |
parent | 24a4cc741a948cd4a01d172a3bfbd68c509b4448 (diff) | |
download | rails-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.rb | 4 |
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 |