aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/visitors/test_to_sql.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index e31d60366b..e7734e2814 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -61,6 +61,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)