mirror of https://github.com/rails/rails
Test for concatenated orders added
[#4972] Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
cae33c4158
commit
a2513aea07
|
@ -110,6 +110,12 @@ class RelationTest < ActiveRecord::TestCase
|
|||
assert_equal topics(:first).title, topics.first.title
|
||||
end
|
||||
|
||||
def test_finding_with_order_concatenated
|
||||
topics = Topic.order('author_name').order('title')
|
||||
assert_equal 4, topics.to_a.size
|
||||
assert_equal topics(:fourth).title, topics.first.title
|
||||
end
|
||||
|
||||
def test_finding_with_order_and_take
|
||||
entrants = Entrant.order("id ASC").limit(2).to_a
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ second:
|
|||
third:
|
||||
id: 3
|
||||
title: The Third Topic of the day
|
||||
author_name: Nick
|
||||
author_name: Carl
|
||||
written_on: 2005-07-15t15:28:00.0099+01:00
|
||||
content: I'm a troll
|
||||
approved: true
|
||||
|
|
Loading…
Reference in New Issue