1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/arel/nodes/sql_literal_spec.rb
2010-08-23 10:14:02 -07:00

19 lines
519 B
Ruby

module Arel
module Nodes
describe 'sql literal' do
describe 'count' do
it 'makes a count node' do
node = SqlLiteral.new('*').count
viz = Visitors::ToSql.new Table.engine
viz.accept(node).should be_like %{ COUNT(*) }
end
it 'makes a distinct node' do
node = SqlLiteral.new('*').count true
viz = Visitors::ToSql.new Table.engine
viz.accept(node).should be_like %{ COUNT(DISTINCT *) }
end
end
end
end
end