提交 53524818 编写于 作者: R Ryuta Kamizono

Add deterministic sorting order for `test_taking_with_a_number`

Otherwise random CI failure will be caused.

https://travis-ci.org/rails/rails/jobs/265848046#L777
上级 18abe37a
......@@ -576,8 +576,16 @@ def test_taking_not_found
end
def test_taking_with_a_number
klass = Class.new(Author) do
has_many :posts, -> { order(:id) }
def self.name
"Author"
end
end
# taking from unloaded Relation
bob = Author.find(authors(:bob).id)
bob = klass.find(authors(:bob).id)
new_post = bob.posts.build
assert_not bob.posts.loaded?
assert_equal [posts(:misc_by_bob)], bob.posts.take(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册