提交 7bf9cbb7 编写于 作者: A Aaron Patterson

adding more test coverage around finding with active record objects

上级 bd96e456
......@@ -432,6 +432,18 @@ def test_where_with_ar_object
assert_equal 1, authors.all.length
end
def test_find_with_list_of_ar
author = Author.first
authors = Author.find([author])
assert_equal author, authors.first
end
def test_find_by_id_with_list_of_ar
author = Author.first
authors = Author.find_by_id([author])
assert_equal author, authors
end
def test_exists
davids = Author.where(:name => 'David')
assert davids.exists?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册