Skip to content
Browse files

Add more test cases

  • Loading branch information...
1 parent e174923 commit eb933f0154f5e10a794552086cf18d1b29b90081 @oriolgual oriolgual committed Jun 8, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/cases/relation_scoping_test.rb
View
8 activerecord/test/cases/relation_scoping_test.rb
@@ -19,6 +19,14 @@ def test_reverse_order_with_arel_node
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

0 comments on commit eb933f0

Please sign in to comment.
Something went wrong with that request. Please try again.