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:
parent
cae33c4158
commit
a2513aea07
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
2
activerecord/test/fixtures/topics.yml
vendored
2
activerecord/test/fixtures/topics.yml
vendored
|
@ -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 a new issue