diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-06-25 14:48:54 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-06-25 14:48:54 -0700 |
commit | 9e1a199568f40f2f26d98731e9dce3646ddf25a9 (patch) | |
tree | a750e70a4a1bd327b2e5ad495f15a913aeacd88c /activerecord/test | |
parent | e5abb89c54ed04e4811cec84c38742e4a6a0c4c5 (diff) | |
parent | 359592bba6cb85b43ca8945917b1ca57fa7494a9 (diff) | |
download | rails-9e1a199568f40f2f26d98731e9dce3646ddf25a9.tar.gz rails-9e1a199568f40f2f26d98731e9dce3646ddf25a9.tar.bz2 rails-9e1a199568f40f2f26d98731e9dce3646ddf25a9.zip |
Merge pull request #6544 from flexoid/issue-6431
exists?(false) returns false
Diffstat (limited to 'activerecord/test')
-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 |