diff options
Diffstat (limited to 'spec/arel/engines/sql/unit/predicates/in_spec.rb')
-rw-r--r-- | spec/arel/engines/sql/unit/predicates/in_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/arel/engines/sql/unit/predicates/in_spec.rb b/spec/arel/engines/sql/unit/predicates/in_spec.rb index 691abcb2d2..76e5fc58df 100644 --- a/spec/arel/engines/sql/unit/predicates/in_spec.rb +++ b/spec/arel/engines/sql/unit/predicates/in_spec.rb @@ -45,6 +45,25 @@ module Arel end end end + + describe 'when the array is empty' do + before do + @array = [] + end + + it 'manufactures sql with a comma separated list' do + sql = In.new(@attribute, @array).to_sql + + adapter_is :mysql do + sql.should be_like(%Q{`users`.`id` IN (NULL)}) + end + + adapter_is_not :mysql do + sql.should be_like(%Q{"users"."id" IN (NULL)}) + end + end + end + end describe 'when relating to a range' do |