aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-18 17:16:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-18 17:16:04 +0000
commit28edbca47728c8fe045a2b47bae925c09c6d5113 (patch)
tree40cd21bfae1e59c890abcb327168b430e0ff214c /activerecord/test/finder_test.rb
parent37249f6a864d6f54cb66168fd2e51b409fb5bc63 (diff)
downloadrails-28edbca47728c8fe045a2b47bae925c09c6d5113.tar.gz
rails-28edbca47728c8fe045a2b47bae925c09c6d5113.tar.bz2
rails-28edbca47728c8fe045a2b47bae925c09c6d5113.zip
Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rwxr-xr-xactiverecord/test/finder_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index 1f6a58dee6..30b0b78313 100755
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -199,6 +199,16 @@ class FinderTest < Test::Unit::TestCase
assert_equal [], Topic.find_all_by_title("The First Topic!!")
end
+
+ def test_find_all_by_boolean_attribute
+ topics = Topic.find_all_by_approved(false)
+ assert_equal 1, topics.size
+ assert topics.include?(@topics["first"].find)
+
+ topics = Topic.find_all_by_approved(true)
+ assert_equal 1, topics.size
+ assert topics.include?(@topics["second"].find)
+ end
def test_find_by_nil_attribute
topic = Topic.find_by_last_read nil