diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-18 14:53:02 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-18 14:53:02 -0700 |
commit | 2a9117d8546941b90126d1548b0bbff85fca145a (patch) | |
tree | f25245493ec2724fc55b38c1be58741944a81d7f /spec/arel | |
parent | d51139751eae2be6ee32b44edec39fcf09ed2333 (diff) | |
download | rails-2a9117d8546941b90126d1548b0bbff85fca145a.tar.gz rails-2a9117d8546941b90126d1548b0bbff85fca145a.tar.bz2 rails-2a9117d8546941b90126d1548b0bbff85fca145a.zip |
when ordering, the last order wins
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/unit/relations/order_spec.rb | 15 |
1 files changed, 2 insertions, 13 deletions
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 |