提交 4e63a7b4 编写于 作者: M Miguel Grazziotin

adding a test to ensure the find is obbeying the limit

上级 91276036
......@@ -78,6 +78,13 @@ def test_find_with_ids_and_order_clause
assert_equal 'The Fifth Topic of the day', records[2].title
end
def test_find_with_ids_and_limit
records = Topic.limit(2).find([4,2,5])
assert_equal 2, records.size
assert_equal 'The Fourth Topic of the day', records[0].title
assert_equal 'The Second Topic of the day', records[1].title
end
def test_find_passing_active_record_object_is_deprecated
assert_deprecated do
Topic.find(Topic.last)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册