aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_postgres.rb
diff options
context:
space:
mode:
authorKeenan Brock <keenan@thebrocks.net>2015-12-05 20:23:48 -0500
committerKeenan Brock <keenan@thebrocks.net>2015-12-05 20:23:48 -0500
commit725cf0502eb279c728bd93320cc5e22134228ff1 (patch)
treecea78b06495af32c84f7fa34f4cc104b6cb3c1bf /test/visitors/test_postgres.rb
parentd2e6be1677b124b3eef5b3ebe0fd4a0d31d8a2bf (diff)
downloadrails-725cf0502eb279c728bd93320cc5e22134228ff1.tar.gz
rails-725cf0502eb279c728bd93320cc5e22134228ff1.tar.bz2
rails-725cf0502eb279c728bd93320cc5e22134228ff1.zip
test match predicate case sensitivity attribute
Diffstat (limited to 'test/visitors/test_postgres.rb')
-rw-r--r--test/visitors/test_postgres.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb
index 5901c56968..4b7dbe367f 100644
--- a/test/visitors/test_postgres.rb
+++ b/test/visitors/test_postgres.rb
@@ -53,6 +53,8 @@ module Arel
describe "Nodes::Matches" do
it "should know how to visit" do
node = @table[:name].matches('foo%')
+ node.must_be_kind_of Nodes::Matches
+ node.case_sensitive.must_equal(false)
compile(node).must_be_like %{
"users"."name" ILIKE 'foo%'
}
@@ -60,6 +62,7 @@ module Arel
it "should know how to visit case sensitive" do
node = @table[:name].matches('foo%', nil, true)
+ node.case_sensitive.must_equal(true)
compile(node).must_be_like %{
"users"."name" LIKE 'foo%'
}
@@ -84,6 +87,8 @@ module Arel
describe "Nodes::DoesNotMatch" do
it "should know how to visit" do
node = @table[:name].does_not_match('foo%')
+ node.must_be_kind_of Nodes::DoesNotMatch
+ node.case_sensitive.must_equal(false)
compile(node).must_be_like %{
"users"."name" NOT ILIKE 'foo%'
}
@@ -91,6 +96,7 @@ module Arel
it "should know how to visit case sensitive" do
node = @table[:name].does_not_match('foo%', nil, true)
+ node.case_sensitive.must_equal(true)
compile(node).must_be_like %{
"users"."name" NOT LIKE 'foo%'
}