diff options
Diffstat (limited to 'spec/arel/algebra')
-rw-r--r-- | spec/arel/algebra/unit/primitives/attribute_spec.rb | 4 | ||||
-rw-r--r-- | spec/arel/algebra/unit/relations/order_spec.rb | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/arel/algebra/unit/primitives/attribute_spec.rb b/spec/arel/algebra/unit/primitives/attribute_spec.rb index afcf1237e0..2ca63ba48e 100644 --- a/spec/arel/algebra/unit/primitives/attribute_spec.rb +++ b/spec/arel/algebra/unit/primitives/attribute_spec.rb @@ -169,13 +169,13 @@ module Arel describe Attribute::Orderings do describe '#asc' do it 'manufactures an ascending ordering' do - pending + @attribute.asc.should == Ascending.new(@attribute) end end describe '#desc' do it 'manufactures a descending ordering' do - pending + @attribute.desc.should == Descending.new(@attribute) end end end diff --git a/spec/arel/algebra/unit/relations/order_spec.rb b/spec/arel/algebra/unit/relations/order_spec.rb index 4f163894c8..8b3c932fb9 100644 --- a/spec/arel/algebra/unit/relations/order_spec.rb +++ b/spec/arel/algebra/unit/relations/order_spec.rb @@ -6,6 +6,16 @@ module Arel @relation = Table.new(:users) @attribute = @relation[:id] end + + describe "#==" do + it "returns true when the Orders are for the same attribute and direction" do + Ascending.new(@attribute).should == Ascending.new(@attribute) + end + + it "returns false when the Orders are for a diferent direction" do + Ascending.new(@attribute).should_not == Descending.new(@attribute) + end + end end end |