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 07458c1dc5..31279b0ae2 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -62,6 +62,12 @@ module Arel sql.must_be_like %{ omg(*) = 2 } end + it 'should handle nil with named functions' do + function = Nodes::NamedFunction.new('omg', [Arel.star]) + sql = compile(function.eq(nil)) + sql.must_be_like %{ omg(*) IS NULL } + end + it 'should visit built-in functions' do function = Nodes::Count.new([Arel.star]) assert_equal 'COUNT(*)', compile(function) |