aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_to_sql.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-06-13 20:09:40 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-06-13 20:09:40 -0300
commit62207faee92c820da9fbc9cc6fe785461c2d826b (patch)
tree5c391827049475110dea8d8fafadff8f7e630d13 /test/visitors/test_to_sql.rb
parentaf07bd12fd182de04a2829a5db3ae1abac299174 (diff)
downloadrails-62207faee92c820da9fbc9cc6fe785461c2d826b.tar.gz
rails-62207faee92c820da9fbc9cc6fe785461c2d826b.tar.bz2
rails-62207faee92c820da9fbc9cc6fe785461c2d826b.zip
Do not generate NOT IN (NULL) when empty right
Diffstat (limited to 'test/visitors/test_to_sql.rb')
-rw-r--r--test/visitors/test_to_sql.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index f832bdf925..58eec1f63b 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -167,10 +167,10 @@ module Arel
}
end
- it "should turn empty right to NULL" do
+ it "should return IN () when empty right which is invalid SQL" do
node = @attr.in []
@visitor.accept(node).must_be_like %{
- "users"."id" IN (NULL)
+ "users"."id" IN ()
}
end
@@ -255,10 +255,10 @@ module Arel
}
end
- it "should turn empty right to NULL" do
+ it "should return NOT IN () when empty right which is invalid SQL" do
node = @attr.not_in []
@visitor.accept(node).must_be_like %{
- "users"."id" NOT IN (NULL)
+ "users"."id" NOT IN ()
}
end