aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/nodes/count_spec.rb
blob: 7013a164292dcc38244305f59f4bb7a37fd3295a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
require 'spec_helper'

describe Arel::Nodes::Count do
  describe "as" do
    it 'should alias the count' do
      table = Arel::Table.new :users
      table[:id].count.as('foo').to_sql.should be_like %{
        COUNT("users"."id") AS foo
      }
    end
  end
end