From 2a9117d8546941b90126d1548b0bbff85fca145a Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Fri, 18 Apr 2008 14:53:02 -0700 Subject: when ordering, the last order wins --- spec/arel/unit/relations/order_spec.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'spec/arel') diff --git a/spec/arel/unit/relations/order_spec.rb b/spec/arel/unit/relations/order_spec.rb index 838a2f141e..514612f047 100644 --- a/spec/arel/unit/relations/order_spec.rb +++ b/spec/arel/unit/relations/order_spec.rb @@ -7,17 +7,6 @@ module Arel @attribute = @relation[:id] end - describe '#initialize' do - before do - @another_attribtue = @relation[:name] - end - - it "manufactures nested Order relations if multiple predicates are provided" do - Order.new(@relation, @predicate, @another_attribute). \ - should == Order.new(Order.new(@relation, @another_attribute), @predicate) - end - end - describe '#to_sql' do describe "when given an attribute" do it "manufactures sql with an order clause populated by the attribute" do @@ -63,11 +52,11 @@ module Arel @another_attribute = @relation[:name] end - it "manufactures sql with an order clause populated by comma-separated attributes" do + it "manufactures sql with the order clause of the last ordering" do Order.new(@ordered_relation, @another_attribute).to_sql.should be_like(" SELECT `users`.`id`, `users`.`name` FROM `users` - ORDER BY `users`.`id`, `users`.`name` + ORDER BY `users`.`name` ") end end -- cgit v1.2.3