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

Fix random CI failure due to non-deterministic sorting order

上级 b9c5c1e2
......@@ -355,7 +355,7 @@ def test_find_by_ids_with_limit_and_offset
# limit of 3 and offset of 9, then you should find that there
# will be only 2 results, regardless of the limit.
devs = Developer.all
last_devs = Developer.limit(3).offset(9).find devs.map(&:id)
last_devs = Developer.limit(3).offset(9).find(devs.map(&:id).sort)
assert_equal 2, last_devs.size
assert_equal "fixture_10", last_devs[0].name
assert_equal "Jamis", last_devs[1].name
......
......@@ -303,13 +303,13 @@ def test_finding_with_reversed_arel_assoc_order
end
def test_reverse_order_with_function
topics = Topic.order(Arel.sql("length(title)")).reverse_order
assert_equal topics(:second).title, topics.first.title
topics = Topic.order(Arel.sql("lower(title)")).reverse_order
assert_equal topics(:third).title, topics.first.title
end
def test_reverse_arel_assoc_order_with_function
topics = Topic.order(Arel.sql("length(title)") => :asc).reverse_order
assert_equal topics(:second).title, topics.first.title
topics = Topic.order(Arel.sql("lower(title)") => :asc).reverse_order
assert_equal topics(:third).title, topics.first.title
end
def test_reverse_order_with_function_other_predicates
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册