aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_mysql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors/test_mysql.rb')
-rw-r--r--test/visitors/test_mysql.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/visitors/test_mysql.rb b/test/visitors/test_mysql.rb
index 3c15c218b2..8d220ac04b 100644
--- a/test/visitors/test_mysql.rb
+++ b/test/visitors/test_mysql.rb
@@ -7,6 +7,16 @@ module Arel
@visitor = MySQL.new Table.engine
end
+ it 'squashes parenthesis on multiple unions' do
+ subnode = Nodes::Union.new 'left', 'right'
+ node = Nodes::Union.new subnode, 'topright'
+ assert_equal 1, @visitor.accept(node).scan('(').length
+
+ subnode = Nodes::Union.new 'left', 'right'
+ node = Nodes::Union.new 'topleft', subnode
+ assert_equal 1, @visitor.accept(node).scan('(').length
+ end
+
###
# :'(
# http://dev.mysql.com/doc/refman/5.0/en/select.html#id3482214