diff options
author | Oriol Gual <oriol.gual@gmail.com> | 2011-06-08 21:08:29 +0200 |
---|---|---|
committer | Oriol Gual <oriol.gual@gmail.com> | 2011-06-28 22:10:51 +0200 |
commit | eb933f0154f5e10a794552086cf18d1b29b90081 (patch) | |
tree | cb0ad853341f9399a3b0516e0ece3b6ad4876bcb /activerecord | |
parent | e174923d29328be9e5373d334ebdb25390687983 (diff) | |
download | rails-eb933f0154f5e10a794552086cf18d1b29b90081.tar.gz rails-eb933f0154f5e10a794552086cf18d1b29b90081.tar.bz2 rails-eb933f0154f5e10a794552086cf18d1b29b90081.zip |
Add more test cases
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/relation_scoping_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb index 5a309af7f7..f2d177d834 100644 --- a/activerecord/test/cases/relation_scoping_test.rb +++ b/activerecord/test/cases/relation_scoping_test.rb @@ -19,6 +19,14 @@ class RelationScopingTest < ActiveRecord::TestCase assert_equal Developer.order("id DESC").to_a.reverse, Developer.order(Developer.arel_table[:id].desc).reverse_order end + def test_reverse_order_with_multiple_arel_nodes + assert_equal Developer.order("id DESC").order("name DESC").to_a.reverse, Developer.order(Developer.arel_table[:id].desc).order(Developer.arel_table[:name].desc).reverse_order + end + + def test_reverse_order_with_arel_nodes_and_strings + assert_equal Developer.order("id DESC").order("name DESC").to_a.reverse, Developer.order("id DESC").order(Developer.arel_table[:name].desc).reverse_order + end + def test_double_reverse_order_produces_original_order assert_equal Developer.order("name DESC"), Developer.order("name DESC").reverse_order.reverse_order end |