diff options
author | Keenan Brock <keenan@thebrocks.net> | 2015-12-05 18:54:09 -0500 |
---|---|---|
committer | Keenan Brock <keenan@thebrocks.net> | 2015-12-05 19:00:33 -0500 |
commit | 508a6783c8f75742ac64e5073b3b211b0c15662a (patch) | |
tree | 6b3dda4f7ac76ae52aa74ccf1bcb3b67f943d720 /test/visitors | |
parent | 3c429c5d86e9e2201c2a35d934ca6a8911c18e69 (diff) | |
download | rails-508a6783c8f75742ac64e5073b3b211b0c15662a.tar.gz rails-508a6783c8f75742ac64e5073b3b211b0c15662a.tar.bz2 rails-508a6783c8f75742ac64e5073b3b211b0c15662a.zip |
Add case sensitive match
Explicitly declare if this is case sensitive or not
most implementation assume case sensitive
postgres assumes case insensitive
Diffstat (limited to 'test/visitors')
-rw-r--r-- | test/visitors/test_postgres.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb index d6de216d91..d00aa1c100 100644 --- a/test/visitors/test_postgres.rb +++ b/test/visitors/test_postgres.rb @@ -58,6 +58,13 @@ module Arel } end + it "should know how to visit case sensitive" do + node = @table[:name].matches('foo%', nil, true) + compile(node).must_be_like %{ + "users"."name" LIKE 'foo%' + } + end + it "can handle ESCAPE" do node = @table[:name].matches('foo!%', '!') compile(node).must_be_like %{ @@ -82,6 +89,13 @@ module Arel } end + it "should know how to visit case sensitive" do + node = @table[:name].does_not_match('foo%', nil, true) + compile(node).must_be_like %{ + "users"."name" NOT LIKE 'foo%' + } + end + it "can handle ESCAPE" do node = @table[:name].does_not_match('foo!%', '!') compile(node).must_be_like %{ |