1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Test for NamedFunction predication chaining

This commit is contained in:
Daniel Azuma 2011-01-19 13:07:38 -08:00
parent af5c81339a
commit e86d4e035b

View file

@ -20,6 +20,12 @@ module Arel
assert_equal 'omg(*)', @visitor.accept(function)
end
it 'should chain predications on named functions' do
function = Nodes::NamedFunction.new('omg', [Arel.star])
sql = @visitor.accept(function.eq(2))
sql.must_be_like %{ omg(*) = 2 }
end
it 'works with lists' do
function = Nodes::NamedFunction.new('omg', [Arel.star, Arel.star])
assert_equal 'omg(*, *)', @visitor.accept(function)