aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/algebra/unit/relations/order_spec.rb
blob: 8b3c932fb9c7c58676045ab13b755c9f7c8db442 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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