aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/finder_test.rb8
-rw-r--r--activerecord/test/fixtures/topics.yml2
2 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index fdbbc68e98..723166c8ad 100755
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -178,6 +178,14 @@ class FinderTest < Test::Unit::TestCase
assert_nil Topic.find_by_title_and_author_name("The First Topic", "Mary")
end
+ def test_find_all_by_one_attribute
+ topics = Topic.find_all_by_content("Have a nice day")
+ assert_equal 2, topics.size
+ assert topics.include?(@topics["first"].find)
+
+ assert_equal [], Topic.find_all_by_title("The First Topic!!")
+ end
+
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)
diff --git a/activerecord/test/fixtures/topics.yml b/activerecord/test/fixtures/topics.yml
index 5571bd914c..f4942acb6c 100644
--- a/activerecord/test/fixtures/topics.yml
+++ b/activerecord/test/fixtures/topics.yml
@@ -15,7 +15,7 @@ second:
title: The Second Topic's of the day
author_name: Mary
written_on: 2003-07-15 15:28:00
- content: Have a great day!
+ content: Have a nice day
approved: 1
replies_count: 2
parent_id: 1