aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_sum.rb
blob: 6e1070427f9b55ac8f498be4e11780a7b85e1649 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
require 'test_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