diff options
Diffstat (limited to 'spec/arel/algebra/unit/relations/order_spec.rb')
-rw-r--r-- | spec/arel/algebra/unit/relations/order_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/arel/algebra/unit/relations/order_spec.rb b/spec/arel/algebra/unit/relations/order_spec.rb new file mode 100644 index 0000000000..8b3c932fb9 --- /dev/null +++ b/spec/arel/algebra/unit/relations/order_spec.rb @@ -0,0 +1,21 @@ +require File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'spec_helper') + +module Arel + describe Order do + before do + @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 + |