aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2014-10-27 09:30:16 -0600
committerSean Griffin <sean@seantheprogrammer.com>2014-10-27 09:30:16 -0600
commitafd98824eb22b67b1f74edd5ea19e4a19a9da981 (patch)
tree400a9d564be166d15cb6566dd78cd251f8aeaef5 /test/visitors
parentdf5723dfbe856abc8c91cc87c609156b432e97d3 (diff)
parentf8d85cf24bca522a04edc5cc48f8716e65efb107 (diff)
downloadrails-afd98824eb22b67b1f74edd5ea19e4a19a9da981.tar.gz
rails-afd98824eb22b67b1f74edd5ea19e4a19a9da981.tar.bz2
rails-afd98824eb22b67b1f74edd5ea19e4a19a9da981.zip
Merge pull request #333 from sgrif/sg-separate-range-method
Deprecate passing ranges to `#in` and `#not_in`
Diffstat (limited to 'test/visitors')
-rw-r--r--test/visitors/test_to_sql.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index 62e1c57c73..9c18d74827 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -375,33 +375,33 @@ module Arel
end
it 'can handle two dot ranges' do
- node = @attr.in 1..3
+ node = @attr.between 1..3
compile(node).must_be_like %{
"users"."id" BETWEEN 1 AND 3
}
end
it 'can handle three dot ranges' do
- node = @attr.in 1...3
+ node = @attr.between 1...3
compile(node).must_be_like %{
"users"."id" >= 1 AND "users"."id" < 3
}
end
it 'can handle ranges bounded by infinity' do
- node = @attr.in 1..Float::INFINITY
+ node = @attr.between 1..Float::INFINITY
compile(node).must_be_like %{
"users"."id" >= 1
}
- node = @attr.in(-Float::INFINITY..3)
+ node = @attr.between(-Float::INFINITY..3)
compile(node).must_be_like %{
"users"."id" <= 3
}
- node = @attr.in(-Float::INFINITY...3)
+ node = @attr.between(-Float::INFINITY...3)
compile(node).must_be_like %{
"users"."id" < 3
}
- node = @attr.in(-Float::INFINITY..Float::INFINITY)
+ node = @attr.between(-Float::INFINITY..Float::INFINITY)
compile(node).must_be_like %{1=1}
end
@@ -479,33 +479,33 @@ module Arel
end
it 'can handle two dot ranges' do
- node = @attr.not_in 1..3
+ node = @attr.not_between 1..3
compile(node).must_equal(
%{("users"."id" < 1 OR "users"."id" > 3)}
)
end
it 'can handle three dot ranges' do
- node = @attr.not_in 1...3
+ node = @attr.not_between 1...3
compile(node).must_equal(
%{("users"."id" < 1 OR "users"."id" >= 3)}
)
end
it 'can handle ranges bounded by infinity' do
- node = @attr.not_in 1..Float::INFINITY
+ node = @attr.not_between 1..Float::INFINITY
compile(node).must_be_like %{
"users"."id" < 1
}
- node = @attr.not_in(-Float::INFINITY..3)
+ node = @attr.not_between(-Float::INFINITY..3)
compile(node).must_be_like %{
"users"."id" > 3
}
- node = @attr.not_in(-Float::INFINITY...3)
+ node = @attr.not_between(-Float::INFINITY...3)
compile(node).must_be_like %{
"users"."id" >= 3
}
- node = @attr.not_in(-Float::INFINITY..Float::INFINITY)
+ node = @attr.not_between(-Float::INFINITY..Float::INFINITY)
compile(node).must_be_like %{1=0}
end