aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_sum.rb
blob: e6a57e4dd643ab3d681fbc10471a516c18646b25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
require 'spec_helper'

describe Arel::Nodes::Sum do
  describe "as" do
    it 'should alias the sum' do
      table = Arel::Table.new :users
      table[:id].sum.as('foo').to_sql.must_be_like %{
        SUM("users"."id") AS foo
      }
    end
  end
end