From cbff1bcf385aba876933b2b4569826e9bc46183c Mon Sep 17 00:00:00 2001 From: Ernie Miller Date: Thu, 14 Jun 2012 11:45:51 -0400 Subject: Fix in [] to be false, in [] to be true This is in response to discussion on 62207fa --- test/visitors/test_to_sql.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/visitors') diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 58eec1f63b..1caedacd45 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -167,11 +167,9 @@ module Arel } end - it "should return IN () when empty right which is invalid SQL" do + it "should return 1=0 when empty right which is always false" do node = @attr.in [] - @visitor.accept(node).must_be_like %{ - "users"."id" IN () - } + @visitor.accept(node).must_equal '1=0' end it 'can handle two dot ranges' do @@ -255,11 +253,9 @@ module Arel } end - it "should return NOT IN () when empty right which is invalid SQL" do + it "should return 1=1 when empty right which is always true" do node = @attr.not_in [] - @visitor.accept(node).must_be_like %{ - "users"."id" NOT IN () - } + @visitor.accept(node).must_equal '1=1' end it 'can handle two dot ranges' do -- cgit v1.2.3