1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Test for concatenated orders added

[#4972]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Santiago Pastorino 2010-06-25 19:22:45 -03:00 committed by José Valim
parent cae33c4158
commit a2513aea07
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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