diff options
Diffstat (limited to 'spec/arel/visitors')
-rw-r--r-- | spec/arel/visitors/to_sql_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/arel/visitors/to_sql_spec.rb b/spec/arel/visitors/to_sql_spec.rb index b277810863..25642ee947 100644 --- a/spec/arel/visitors/to_sql_spec.rb +++ b/spec/arel/visitors/to_sql_spec.rb @@ -72,6 +72,20 @@ module Arel "users"."id" IN (NULL) } end + + it 'can handle two dot ranges' do + node = @attr.in 1..3 + @visitor.accept(node).should be_like %{ + "users"."id" BETWEEN 1 AND 3 + } + end + + it 'can handle three dot ranges' do + node = @attr.in 1...3 + @visitor.accept(node).should be_like %{ + "users"."id" >= 1 AND "users"."id" < 3 + } + end end describe 'Equality' do |