diff options
-rw-r--r-- | test/visitors/test_to_sql.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 0c7baab923..c8ad40e242 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -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) |