Sha256: 322faf1d3b932d0773e164b563c5c4e2ac8ec0354f2d7e4df180efaf3809522a
Contents?: true
Size: 821 Bytes
Versions: 2
Compression:
Stored size: 821 Bytes
Contents
require '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.must_be_like %{ COUNT("users"."id") AS foo } end end describe "eq" do it "should compare the count" do table = Arel::Table.new :users table[:id].count.eq(2).to_sql.must_be_like %{ COUNT("users"."id") = 2 } end end describe 'equality' do it 'is equal with equal ivars' do array = [Arel::Nodes::Count.new('foo'), Arel::Nodes::Count.new('foo')] assert_equal 1, array.uniq.size end it 'is not equal with different ivars' do array = [Arel::Nodes::Count.new('foo'), Arel::Nodes::Count.new('foo!')] assert_equal 2, array.uniq.size end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
arel-6.0.0.beta2 | test/nodes/test_count.rb |
arel-6.0.0.beta1 | test/nodes/test_count.rb |