diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-12 17:39:40 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-12 17:39:40 -0300 |
commit | f8c0202f46e52761082c6ff4a1f3eedec1d1ddc2 (patch) | |
tree | 7a3a8a77e7617326d86d0f775ed6ed61fa12075f /test/visitors/test_to_sql.rb | |
parent | 36836fa5e7c084c0dce2818577e6fd0cf815f786 (diff) | |
parent | 416ad003716bcc883c319ec30644bab8a3cf52c7 (diff) | |
download | rails-f8c0202f46e52761082c6ff4a1f3eedec1d1ddc2.tar.gz rails-f8c0202f46e52761082c6ff4a1f3eedec1d1ddc2.tar.bz2 rails-f8c0202f46e52761082c6ff4a1f3eedec1d1ddc2.zip |
Merge pull request #277 from sergey-alekseev/wrap-nested-gropings-only-once
Wrap nested Nodes::Grouping in brackets only once
Diffstat (limited to 'test/visitors/test_to_sql.rb')
-rw-r--r-- | test/visitors/test_to_sql.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index a88c888908..c03d89cfef 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -131,6 +131,13 @@ module Arel end end + describe 'Nodes::Grouping' do + it 'wraps nested groupings in brackets only once' do + sql = compile Nodes::Grouping.new(Nodes::Grouping.new(Nodes.build_quoted('foo'))) + sql.must_equal "('foo')" + end + end + describe 'Nodes::NotEqual' do it 'should handle false' do val = Nodes.build_quoted(false, @table[:active]) |